diff options
Diffstat (limited to 'sw/source/core/txtnode/atrflyin.cxx')
-rw-r--r-- | sw/source/core/txtnode/atrflyin.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index 02da2c32be8a..d3076e642ef5 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -28,11 +28,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #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 @@ -117,9 +116,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? @@ -146,7 +144,6 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc ) } SwFrmFmt* pNew = pDoc->CopyLayoutFmt( *pFmt, aAnchor, false, false ); - pDoc->DoUndo( bUndo ); ((SwFmtFlyCnt&)GetFlyCnt()).SetFlyFmt( pNew ); } @@ -193,16 +190,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() && |