Kaydet (Commit) 91fab30f authored tarafından Michael Stahl's avatar Michael Stahl

fdo#46482: prevent duplication of frames:

SwDoc::MakeFlySection: abuse the SwDoc::mbRedlineMove flag, which
(with the fix for fdo#40599) does exactly what is necessary to prevent
the spurious copies.
Also, remove the ugly hack to work around this problem from
SwXText::convertToTextFrame.
üst 23e52c20
...@@ -840,8 +840,10 @@ if( GetIDocumentUndoRedo().DoesUndo() ) ...@@ -840,8 +840,10 @@ if( GetIDocumentUndoRedo().DoesUndo() )
SwPaM* pTmp = (SwPaM*)&rPam; SwPaM* pTmp = (SwPaM*)&rPam;
sal_Bool bOldFlag = mbCopyIsMove; sal_Bool bOldFlag = mbCopyIsMove;
bool const bOldUndo = GetIDocumentUndoRedo().DoesUndo(); bool const bOldUndo = GetIDocumentUndoRedo().DoesUndo();
bool const bOldRedlineMove(IsRedlineMove());
mbCopyIsMove = sal_True; mbCopyIsMove = sal_True;
GetIDocumentUndoRedo().DoUndo(false); GetIDocumentUndoRedo().DoUndo(false);
SetRedlineMove(true);
do { do {
if( pTmp->HasMark() && if( pTmp->HasMark() &&
*pTmp->GetPoint() != *pTmp->GetMark() ) *pTmp->GetPoint() != *pTmp->GetMark() )
...@@ -850,6 +852,7 @@ if( GetIDocumentUndoRedo().DoesUndo() ) ...@@ -850,6 +852,7 @@ if( GetIDocumentUndoRedo().DoesUndo() )
} }
pTmp = static_cast<SwPaM*>(pTmp->GetNext()); pTmp = static_cast<SwPaM*>(pTmp->GetNext());
} while ( &rPam != pTmp ); } while ( &rPam != pTmp );
SetRedlineMove(bOldRedlineMove);
mbCopyIsMove = bOldFlag; mbCopyIsMove = bOldFlag;
GetIDocumentUndoRedo().DoUndo(bOldUndo); GetIDocumentUndoRedo().DoUndo(bOldUndo);
......
...@@ -1720,12 +1720,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) ...@@ -1720,12 +1720,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
SwFmtAnchor aAnchor((*i)->GetAnchor()); SwFmtAnchor aAnchor((*i)->GetAnchor());
aAnchor.SetAnchor(aMovePam.Start()); aAnchor.SetAnchor(aMovePam.Start());
m_pImpl->m_pDoc->SetAttr(aAnchor, *(*i)); m_pImpl->m_pDoc->SetAttr(aAnchor, *(*i));
// delete the old anchor
SwSpzFrmFmts* pFrmFmts = m_pImpl->m_pDoc->GetSpzFrmFmts();
// here we rely on that fact that this is a sorted list, where the last element is the newly created frame
SwFrmFmt *pFrmFmt = (*pFrmFmts)[pFrmFmts->Count()-1];
m_pImpl->m_pDoc->DelLayoutFmt(pFrmFmt);
} }
} }
} }
......
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