Kaydet (Commit) 11c94c17 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwDoc::DelLayoutFmt: don't delete content of a draw format

In case a shape (has a draw format) has a textbox (RES_CNTNT of the draw
format), then that's just a pointer to that content, but the draw format
doesn't own it: the matching fly format does. So ignore that content
when deleting the layout format in case of draw formats: that ensures
when both the draw and the fly format is deleted, deletion is only
performed once.

Change-Id: Idb4bb19130a6b9acd8f8d3710b9982801b416dda
üst e509b930
......@@ -216,7 +216,10 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
SetAttr( aChain, *rChain.GetNext() );
}
const SwNodeIndex* pCntIdx = pFmt->GetCntnt().GetCntntIdx();
const SwNodeIndex* pCntIdx = 0;
// The draw format doesn't own its content, it just has a pointer to it.
if (pFmt->Which() != RES_DRAWFRMFMT)
pCntIdx = pFmt->GetCntnt().GetCntntIdx();
if (pCntIdx && !GetIDocumentUndoRedo().DoesUndo())
{
// Disconnect if it's an OLE object
......@@ -257,7 +260,9 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
if ( nWh == RES_FLYFRMFMT )
{
// determine frame formats of at-frame anchored objects
const SwNodeIndex* pCntntIdx = pFmt->GetCntnt().GetCntntIdx();
const SwNodeIndex* pCntntIdx = 0;
if (pFmt->Which() != RES_DRAWFRMFMT)
pFmt->GetCntnt().GetCntntIdx();
if ( pCntntIdx )
{
const SwFrmFmts* pTbl = pFmt->GetDoc()->GetSpzFrmFmts();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment