summaryrefslogtreecommitdiff
path: root/tools/source/generic/poly2.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-26 09:35:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-26 16:29:13 +0100
commitcd29cab883a6a7a0e028ca6756daa2f3cc8d51f6 (patch)
treed2626221e24b967147e2be18e2b389095d0373b2 /tools/source/generic/poly2.cxx
parent112645f75816c4902ccf8a2a97ef57e8f13429b8 (diff)
check for self-assign
Change-Id: I6ffaaa36f2e594a2e8155589a4d7000db21ab30b
Diffstat (limited to 'tools/source/generic/poly2.cxx')
-rw-r--r--tools/source/generic/poly2.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx
index 7ef7df199f4f..0262a36a0af6 100644
--- a/tools/source/generic/poly2.cxx
+++ b/tools/source/generic/poly2.cxx
@@ -521,6 +521,9 @@ Polygon& PolyPolygon::operator[]( sal_uInt16 nPos )
PolyPolygon& PolyPolygon::operator=( const PolyPolygon& rPolyPoly )
{
+ if (this == &rPolyPoly)
+ return *this;
+
DBG_ASSERT( rPolyPoly.mpImplPolyPolygon->mnRefCount < 0xFFFFFFFE, "PolyPolygon: RefCount overflow" );
rPolyPoly.mpImplPolyPolygon->mnRefCount++;