diff options
Diffstat (limited to 'sw/source/core/doc/docdesc.cxx')
-rw-r--r-- | sw/source/core/doc/docdesc.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index d7f88e671825..463e15bf6b6e 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <hintids.hxx> #include <vcl/virdev.hxx> #include <svx/svdmodel.hxx> @@ -48,6 +49,7 @@ #include <ndole.hxx> #include <mdiexp.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <docary.hxx> #include <pagefrm.hxx> //Fuer DelPageDesc #include <rootfrm.hxx> //Fuer DelPageDesc @@ -55,9 +57,7 @@ #include <frmtool.hxx> #include <pagedesc.hxx> #include <poolfmt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <ndindex.hxx> #include <ftnidx.hxx> #include <fmtftn.hxx> @@ -69,9 +69,8 @@ #include <swwait.hxx> #include <GetMetricVal.hxx> #include <unotools/syslocale.hxx> -#ifndef _STATSTR_HRC #include <statstr.hrc> -#endif +#include <hints.hxx> #include <SwUndoPageDesc.hxx> @@ -203,12 +202,12 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) SwPageDesc *pDesc = aPageDescs[i]; - sal_Bool bDoesUndo = DoesUndo(); - if (DoesUndo()) + if (GetIDocumentUndoRedo().DoesUndo()) { - AppendUndo(new SwUndoPageDesc(*pDesc, rChged, this)); - DoUndo(sal_False); + SwUndo *const pUndo(new SwUndoPageDesc(*pDesc, rChged, this)); + GetIDocumentUndoRedo().AppendUndo(pUndo); } + ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); //Als erstes wird ggf. gespiegelt. if ( rChged.GetUseOn() == nsUseOnPage::PD_MIRROR ) @@ -247,7 +246,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) //Header abgleichen. const SwFmtHeader &rHead = rChged.GetMaster().GetHeader(); - if( bDoesUndo ) + if (undoGuard.UndoWasEnabled()) { // #i46909# no undo if header or footer changed // hat sich an den Nodes etwas veraendert ? @@ -311,7 +310,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) //Footer abgleichen. const SwFmtFooter &rFoot = rChged.GetMaster().GetFooter(); - if( bDoesUndo ) + if (undoGuard.UndoWasEnabled()) { // #i46909# no undo if header or footer changed // hat sich an den Nodes etwas veraendert ? @@ -426,13 +425,10 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) } SetModified(); - DoUndo(bDoesUndo); - // #i46909# no undo if header or footer changed if( bHeaderFooterChanged ) { - ClearRedo(); - DelAllUndoObj(); + GetIDocumentUndoRedo().DelAllUndoObj(); } } @@ -570,9 +566,10 @@ void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast ) SFX_STYLESHEET_ERASED); // <- #116530# - if (DoesUndo()) + if (GetIDocumentUndoRedo().DoesUndo()) { - AppendUndo(new SwUndoPageDescDelete(*pDel, this)); + SwUndo *const pUndo(new SwUndoPageDescDelete(*pDel, this)); + GetIDocumentUndoRedo().AppendUndo(pUndo); } PreDelPageDesc(pDel); // #i7983# @@ -629,8 +626,11 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy, SFX_STYLESHEET_CREATED); // <- #116530# - if (DoesUndo()) - AppendUndo(new SwUndoPageDescCreate(pNew, this)); // #116530# + if (GetIDocumentUndoRedo().DoesUndo()) + { + // #116530# + GetIDocumentUndoRedo().AppendUndo(new SwUndoPageDescCreate(pNew, this)); + } SetModified(); return (aPageDescs.Count()-1); |