In ultrarelativistic heavy-ion collisions, the event-by-event variation of the elliptic flow v2 reflects fluctuations in the shape of the initial state of the system. This allows to select events with the same centrality but different initial geometry. This selection technique, Event Shape Engineering, has been used in the analysis of charge-dependent two- and three-particle correlations in Pb–Pb collisions at sNN=2.76 TeV. The two-particle correlator 〈cos(φα−φβ)〉 calculated for different combinations of charges α and β is almost independent of v2 (for a given centrality), while the three-particle correlator 〈cos(φα+φβ−2Ψ2)〉 scales almost linearly both with the event v2 and charged-particle pseudorapidity density. The charge dependence of the three-particle correlator is often interpreted as evidence for the Chiral Magnetic Effect (CME), a parity violating effect of the strong interaction. However, its measured dependence on v2 points to a large non-CME contribution to the correlator. Comparing the results with Monte Carlo calculations including a magnetic field due to the spectators, the upper limit of the CME signal contribution to the three-particle correlator in the 10–50% centrality interval is found to be 26–33% at 95% confidence level.