summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unodraw.cxx
diff options
context:
space:
mode:
authorOliver Specht <os@openoffice.org>2003-05-08 07:51:08 +0000
committerOliver Specht <os@openoffice.org>2003-05-08 07:51:08 +0000
commit9a3067b4f7ac278c62ae83bbb13eb05e242f11d1 (patch)
tree6b5759682e9fa5931009c021795bfd1608d2d138 /sw/source/core/unocore/unodraw.cxx
parent23af0c84e8e9347d4d74529abe4a47e41ceaffc3 (diff)
#109429# dispose: remove draw object only if it's still inserted
Diffstat (limited to 'sw/source/core/unocore/unodraw.cxx')
-rw-r--r--sw/source/core/unocore/unodraw.cxx37
1 files changed, 21 insertions, 16 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 88d4ee9624de..767ce3f0ed73 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: unodraw.cxx,v $
*
- * $Revision: 1.46 $
+ * $Revision: 1.47 $
*
- * last change: $Author: os $ $Date: 2003-05-06 13:34:12 $
+ * last change: $Author: os $ $Date: 2003-05-08 08:51:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1588,23 +1588,28 @@ void SwXShape::dispose(void) throw( RuntimeException )
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
- if( pFmt->GetAnchor().GetAnchorId() == FLY_IN_CNTNT )
- {
- const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor());
- SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode();
- const xub_StrLen nIdx = rPos.nContent.GetIndex();
- pTxtNode->Delete( RES_TXTATR_FLYCNT, nIdx, nIdx );
- }
+ SdrObject* pObj = pFmt->FindSdrObject();
+ if(pObj && pObj->IsInserted())
+ {
+ if( pFmt->GetAnchor().GetAnchorId() == FLY_IN_CNTNT )
+ {
+ const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor());
+ SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode();
+ const xub_StrLen nIdx = rPos.nContent.GetIndex();
+ pTxtNode->Delete( RES_TXTATR_FLYCNT, nIdx, nIdx );
+ }
else
pFmt->GetDoc()->DelLayoutFmt( pFmt );
- uno::Any aAgg(xShapeAgg->queryAggregation( ::getCppuType((Reference<XComponent>*)0)));
- Reference<XComponent> xComp;
- aAgg >>= xComp;
- if(xComp.is())
- xComp->dispose();
+ }
+ }
+ if(xShapeAgg.is())
+ {
+ uno::Any aAgg(xShapeAgg->queryAggregation( ::getCppuType((Reference<XComponent>*)0)));
+ Reference<XComponent> xComp;
+ aAgg >>= xComp;
+ if(xComp.is())
+ xComp->dispose();
}
-// else
-// throw RuntimeException();
}
/* -----------------14.04.99 13:02-------------------
*