diff options
Diffstat (limited to 'basegfx/source/polygon/b2dpolygon.cxx')
-rw-r--r-- | basegfx/source/polygon/b2dpolygon.cxx | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/basegfx/source/polygon/b2dpolygon.cxx b/basegfx/source/polygon/b2dpolygon.cxx index 4d2b681911e2..3c85a2666d25 100644 --- a/basegfx/source/polygon/b2dpolygon.cxx +++ b/basegfx/source/polygon/b2dpolygon.cxx @@ -664,41 +664,34 @@ public: bool operator==(const ImplB2DPolygon& rCandidate) const { - if(mbIsClosed == rCandidate.mbIsClosed) + if(mbIsClosed != rCandidate.mbIsClosed) + return false; + if(!(maPoints == rCandidate.maPoints)) + return false; + bool bControlVectorsAreEqual(true); + + if(moControlVector) { - if(maPoints == rCandidate.maPoints) + if(rCandidate.moControlVector) { - bool bControlVectorsAreEqual(true); - - if(moControlVector) - { - if(rCandidate.moControlVector) - { - bControlVectorsAreEqual = ((*moControlVector) == (*rCandidate.moControlVector)); - } - else - { - // candidate has no control vector, so it's assumed all unused. - bControlVectorsAreEqual = !moControlVector->isUsed(); - } - } - else - { - if(rCandidate.moControlVector) - { - // we have no control vector, so it's assumed all unused. - bControlVectorsAreEqual = !rCandidate.moControlVector->isUsed(); - } - } - - if(bControlVectorsAreEqual) - { - return true; - } + bControlVectorsAreEqual = ((*moControlVector) == (*rCandidate.moControlVector)); + } + else + { + // candidate has no control vector, so it's assumed all unused. + bControlVectorsAreEqual = !moControlVector->isUsed(); + } + } + else + { + if(rCandidate.moControlVector) + { + // we have no control vector, so it's assumed all unused. + bControlVectorsAreEqual = !rCandidate.moControlVector->isUsed(); } } - return false; + return bControlVectorsAreEqual; } const basegfx::B2DPoint& getPoint(sal_uInt32 nIndex) const |