summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/bigint.cxx3
-rw-r--r--tools/source/generic/poly2.cxx3
2 files changed, 6 insertions, 0 deletions
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx
index e7a98b5eebec..3311efd459b5 100644
--- a/tools/source/generic/bigint.cxx
+++ b/tools/source/generic/bigint.cxx
@@ -616,6 +616,9 @@ BigInt::operator double() const
BigInt& BigInt::operator=( const BigInt& rBigInt )
{
+ if (this == &rBigInt)
+ return *this;
+
if ( rBigInt.bIsBig )
memcpy( (void*)this, (const void*)&rBigInt, sizeof( BigInt ) );
else
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++;