diff options
Diffstat (limited to 'sw/source/core/txtnode/atrflyin.cxx')
-rw-r--r-- | sw/source/core/txtnode/atrflyin.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index f98ca5595bb5..dbcc5d06b8d1 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -31,6 +31,7 @@ #include "hintids.hxx" #include "cntfrm.hxx" // _GetFly #include "doc.hxx" +#include <IDocumentUndoRedo.hxx> #include "pam.hxx" // fuer SwTxtFlyCnt #include "flyfrm.hxx" // fuer SwTxtFlyCnt #include "ndtxt.hxx" // SwFlyFrmFmt @@ -114,9 +115,8 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc ) // In CopyLayoutFmt (siehe doclay.cxx) wird das FlyFrmFmt erzeugt // und der Inhalt dupliziert. - // fuers kopieren vom Attribut das Undo immer abschalten - BOOL bUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + // disable undo while copying attribute + ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); SwFmtAnchor aAnchor( pFmt->GetAnchor() ); if ((FLY_AT_PAGE != aAnchor.GetAnchorId()) && (pDoc != pFmt->GetDoc())) // different documents? @@ -143,7 +143,6 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc ) } SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false ); - pDoc->DoUndo( bUndo ); ((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew ); } @@ -190,16 +189,13 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode ) // stehen wir noch im falschen Dokument ? if( pDoc != pFmt->GetDoc() ) { - // fuers kopieren vom Attribut das Undo immer abschalten - BOOL bUndo = pDoc->DoesUndo(); - pDoc->DoUndo( FALSE ); + // disable undo while copying attribute + ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false ); - pDoc->DoUndo( bUndo ); - bUndo = pFmt->GetDoc()->DoesUndo(); - pFmt->GetDoc()->DoUndo( FALSE ); + ::sw::UndoGuard const undoGuardFmt( + pFmt->GetDoc()->GetIDocumentUndoRedo()); pFmt->GetDoc()->DelLayoutFmt( pFmt ); - pFmt->GetDoc()->DoUndo( bUndo ); ((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew ); } else if( pNode->GetpSwpHints() && |