diff --git a/src/core/geometry/qgscompoundcurve.cpp b/src/core/geometry/qgscompoundcurve.cpp index 83adc35835c9..7fcc2e1344da 100644 --- a/src/core/geometry/qgscompoundcurve.cpp +++ b/src/core/geometry/qgscompoundcurve.cpp @@ -119,11 +119,11 @@ QgsCompoundCurve::QgsCompoundCurve( const QgsCompoundCurve &curve ): QgsCurve( c } } +// cppcheck-suppress operatorEqVarError QgsCompoundCurve &QgsCompoundCurve::operator=( const QgsCompoundCurve &curve ) { if ( &curve != this ) { - clearCache(); QgsCurve::operator=( curve ); for ( const QgsCurve *c : curve.mCurves ) { diff --git a/tests/src/core/geometry/testqgscompoundcurve.cpp b/tests/src/core/geometry/testqgscompoundcurve.cpp index 25f44dcb69db..72184bf75d5f 100644 --- a/tests/src/core/geometry/testqgscompoundcurve.cpp +++ b/tests/src/core/geometry/testqgscompoundcurve.cpp @@ -619,6 +619,13 @@ void TestQgsCompoundCurve::assignment() QVERIFY( cc1 != cc2 ); + QgsLineString ls2; + ls2.setPoints( QgsPointSequence() << QgsPoint( Qgis::WkbType::PointM, 3, 4, 5, 6 ) + << QgsPoint( Qgis::WkbType::PointM, 1 / 2.0, 5 / 7.0, 1, 3 ) + << QgsPoint( Qgis::WkbType::PointM, 2, 3, 5, 7 ) ); + cc2.addCurve( ls2.clone() ); + QVERIFY( cc1 != cc2 ); + cc2 = cc1; QCOMPARE( cc1, cc2 ); }