summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/unodraw/unoshape.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 98a104c49fc8..ee3e58dd0190 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1286,10 +1286,6 @@ void SAL_CALL SvxShape::dispose()
if ( pObject->IsInserted() && pObject->getSdrPageFromSdrObject() )
{
- OSL_ENSURE( HasSdrObjectOwnership(), "SvxShape::dispose: is the below code correct?" );
- // normally, we are allowed to free the SdrObject only if we have its ownership.
- // Why isn't this checked here?
-
SdrPage* pPage = pObject->getSdrPageFromSdrObject();
// delete the SdrObject from the page
const size_t nCount = pPage->GetObjCount();
@@ -1298,7 +1294,10 @@ void SAL_CALL SvxShape::dispose()
if ( pPage->GetObj( nNum ) == pObject )
{
OSL_VERIFY( pPage->RemoveObject( nNum ) == pObject );
- bFreeSdrObject = true;
+ if (HasSdrObjectOwnership())
+ {
+ bFreeSdrObject = true;
+ }
break;
}
}