Skip to content
Permalink
Browse files

Fix crash when calling equality operator on QgsCircularString

  • Loading branch information
nyalldawson committed Sep 18, 2017
1 parent 3d0d7aa commit e937782757afc9de1132f09e58ee4ade43e6322b
Showing with 20 additions and 1 deletion.
  1. +20 −1 src/core/geometry/qgscircularstring.cpp
@@ -38,7 +38,26 @@ bool QgsCircularString::operator==( const QgsCurve &other ) const
if ( !otherLine )
return false;

return *otherLine == *this;
if ( mWkbType != otherLine->mWkbType )
return false;

if ( mX.count() != otherLine->mX.count() )
return false;

for ( int i = 0; i < mX.count(); ++i )
{
if ( !qgsDoubleNear( mX.at( i ), otherLine->mX.at( i ) )
|| !qgsDoubleNear( mY.at( i ), otherLine->mY.at( i ) ) )
return false;

if ( is3D() && !qgsDoubleNear( mZ.at( i ), otherLine->mZ.at( i ) ) )
return false;

if ( isMeasure() && !qgsDoubleNear( mM.at( i ), otherLine->mM.at( i ) ) )
return false;
}

return true;
}

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

0 comments on commit e937782

Please sign in to comment.
You can’t perform that action at this time.