Skip to content

Commit e937782

Browse files
committed
Fix crash when calling equality operator on QgsCircularString
1 parent 3d0d7aa commit e937782

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/core/geometry/qgscircularstring.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,26 @@ bool QgsCircularString::operator==( const QgsCurve &other ) const
3838
if ( !otherLine )
3939
return false;
4040

41-
return *otherLine == *this;
41+
if ( mWkbType != otherLine->mWkbType )
42+
return false;
43+
44+
if ( mX.count() != otherLine->mX.count() )
45+
return false;
46+
47+
for ( int i = 0; i < mX.count(); ++i )
48+
{
49+
if ( !qgsDoubleNear( mX.at( i ), otherLine->mX.at( i ) )
50+
|| !qgsDoubleNear( mY.at( i ), otherLine->mY.at( i ) ) )
51+
return false;
52+
53+
if ( is3D() && !qgsDoubleNear( mZ.at( i ), otherLine->mZ.at( i ) ) )
54+
return false;
55+
56+
if ( isMeasure() && !qgsDoubleNear( mM.at( i ), otherLine->mM.at( i ) ) )
57+
return false;
58+
}
59+
60+
return true;
4261
}
4362

4463
bool QgsCircularString::operator!=( const QgsCurve &other ) const

0 commit comments

Comments
 (0)