diff options
Diffstat (limited to 'sw/source/ui/app/apphdl.cxx')
-rw-r--r-- | sw/source/ui/app/apphdl.cxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index df6e9af0eca3..91e4dc5bc61a 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <hintids.hxx> #include <tools/urlobj.hxx> @@ -71,9 +72,7 @@ #include <srcview.hxx> #include <wrtsh.hxx> #include <docsh.hxx> -#ifndef _CMDID_H #include <cmdid.h> // Funktion-Ids -#endif #include <initui.hxx> #include <uitool.hxx> #include <swmodule.hxx> @@ -83,13 +82,12 @@ #include <gloslst.hxx> // SwGlossaryList #include <glosdoc.hxx> // SwGlossaryList #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <cfgitems.hxx> #include <prtopt.hxx> #include <modcfg.hxx> #include <globals.h> // globale Konstanten z.B. -#ifndef _APP_HRC #include <app.hrc> -#endif #include <fontcfg.hxx> #include <barcfg.hxx> #include <uinums.hxx> @@ -802,22 +800,18 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal } else if( pBrdCst == pUndoOptions ) { - const int nNew = GetUndoOptions().GetUndoCount(); - const int nOld = SwEditShell::GetUndoActionCount(); - if(!nNew || !nOld) + sal_Int32 const nNew = GetUndoOptions().GetUndoCount(); + bool const bUndo = (nNew != 0); + // switch Undo for all DocShells + TypeId aType(TYPE(SwDocShell)); + SwDocShell * pDocShell = + static_cast<SwDocShell *>(SfxObjectShell::GetFirst(&aType)); + while (pDocShell) { - sal_Bool bUndo = nNew != 0; - //ueber DocShells iterieren und Undo umschalten - - TypeId aType(TYPE(SwDocShell)); - SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType); - while( pDocShell ) - { - pDocShell->GetDoc()->DoUndo( bUndo ); - pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType); - } + pDocShell->GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo); + pDocShell = static_cast<SwDocShell *>( + SfxObjectShell::GetNext(*pDocShell, &aType)); } - SwEditShell::SetUndoActionCount( static_cast< sal_uInt16 >(nNew)); } else if ( pBrdCst == pColorConfig || pBrdCst == pAccessibilityOptions ) { |