diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-01-27 15:03:39 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-01-27 15:04:26 +0100 |
commit | 452d86c9cbfb6b4b7e86426931a0d982dd8bb180 (patch) | |
tree | 4f80b7cc380d731c71f566ee7e91b2e300126360 /sw | |
parent | db59e4481614f58e111a86a1926e49fb523ebbae (diff) |
Replace SvtUndoOptions with (simplified) direct configuration access.
Also, code in sw can be simplified under the premise that always
/org.openoffice.Office.Common/Undo/Steps > 0.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/swmodule.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/undo/docundo.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/app/apphdl.cxx | 32 | ||||
-rw-r--r-- | sw/source/ui/app/swmodule.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/inc/inputwin.hxx | 1 | ||||
-rw-r--r-- | sw/source/ui/ribbar/inputwin.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/uiview/view.cxx | 9 |
7 files changed, 14 insertions, 52 deletions
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx index 70cae0f5008d..72f026a0255e 100644 --- a/sw/inc/swmodule.hxx +++ b/sw/inc/swmodule.hxx @@ -62,7 +62,6 @@ namespace svtools{ class ColorConfig;} class SvtAccessibilityOptions; class SvtCTLOptions; class SvtUserOptions; -class SvtUndoOptions; struct SwDBData; #define VIEWOPT_DEST_VIEW 0 @@ -94,7 +93,6 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C SvtAccessibilityOptions* pAccessibilityOptions; SvtCTLOptions* pCTLOptions; SvtUserOptions* pUserOptions; - SvtUndoOptions* pUndoOptions; SfxErrorHandler* pErrorHdl; @@ -180,7 +178,6 @@ public: SvtAccessibilityOptions& GetAccessibilityOptions(); SvtCTLOptions& GetCTLOptions(); SvtUserOptions& GetUserOptions(); - SvtUndoOptions& GetUndoOptions(); // Iterate over views. static SwView* GetFirstView(); diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx index abc863ec211f..18dc5b654d29 100644 --- a/sw/source/core/undo/docundo.cxx +++ b/sw/source/core/undo/docundo.cxx @@ -29,8 +29,6 @@ #include <UndoManager.hxx> -#include <unotools/undoopt.hxx> - #include <vcl/wrkwin.hxx> #include <svx/svdmodel.hxx> diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx index 716300ef3d6e..34fce61edd66 100644 --- a/sw/source/ui/app/apphdl.cxx +++ b/sw/source/ui/app/apphdl.cxx @@ -32,7 +32,6 @@ #include <tools/link.hxx> #include <svl/svstdarr.hxx> #include <svl/urihelper.hxx> -#include <unotools/undoopt.hxx> #include <unotools/pathoptions.hxx> #include <svtools/accessibilityoptions.hxx> #include <sfx2/dispatch.hxx> @@ -770,11 +769,6 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) pUserOptions->RemoveListener(this); DELETEZ(pUserOptions); } - if( pUndoOptions ) - { - pUndoOptions->RemoveListener(this); - DELETEZ(pUndoOptions); - } } } } @@ -785,22 +779,6 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, sal { bAuthorInitialised = sal_False; } - else if( pBrdCst == pUndoOptions ) - { - sal_Int32 const nNew = GetUndoOptions().GetUndoCount(); - bool const bUndo = (nNew != 0); - // switch Undo for all DocShells - // Iterate through DocShells and switch undos - TypeId aType(TYPE(SwDocShell)); - SwDocShell * pDocShell = - static_cast<SwDocShell *>(SfxObjectShell::GetFirst(&aType)); - while (pDocShell) - { - pDocShell->GetDoc()->GetIDocumentUndoRedo().DoUndo(bUndo); - pDocShell = static_cast<SwDocShell *>( - SfxObjectShell::GetNext(*pDocShell, &aType)); - } - } else if ( pBrdCst == pColorConfig || pBrdCst == pAccessibilityOptions ) { sal_Bool bAccessibility = sal_False; @@ -902,16 +880,6 @@ SvtUserOptions& SwModule::GetUserOptions() return *pUserOptions; } -SvtUndoOptions& SwModule::GetUndoOptions() -{ - if(!pUndoOptions) - { - pUndoOptions = new SvtUndoOptions; - pUndoOptions->AddListener(this); - } - return *pUndoOptions; -} - const SwMasterUsrPref *SwModule::GetUsrPref(sal_Bool bWeb) const { SwModule* pNonConstModule = (SwModule*)this; diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx index bbaff8f75a53..b37b86f6e370 100644 --- a/sw/source/ui/app/swmodule.cxx +++ b/sw/source/ui/app/swmodule.cxx @@ -176,7 +176,6 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, pAccessibilityOptions(0), pCTLOptions(0), pUserOptions(0), - pUndoOptions(0), pAttrPool(0), pView(0), bAuthorInitialised(sal_False), diff --git a/sw/source/ui/inc/inputwin.hxx b/sw/source/ui/inc/inputwin.hxx index 0c9b185bf1ca..0040d435c081 100644 --- a/sw/source/ui/inc/inputwin.hxx +++ b/sw/source/ui/inc/inputwin.hxx @@ -67,7 +67,6 @@ friend class InputEdit; SwView* pView; SfxBindings* pBindings; String aAktTableName, sOldFml; - sal_Int32 m_nActionCount; sal_Bool bFirst : 1; // initialisations at first call sal_Bool bActive : 1; // for hide/show when switching documents diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx index 9657ca359da6..34497e82f274 100644 --- a/sw/source/ui/ribbar/inputwin.cxx +++ b/sw/source/ui/ribbar/inputwin.cxx @@ -26,8 +26,10 @@ * ************************************************************************/ +#include "sal/config.h" - +#include <comphelper/processfactory.hxx> +#include <officecfg/Office/Common.hxx> #include <tools/gen.hxx> #include <sfx2/imgmgr.hxx> #include <sfx2/viewfrm.hxx> @@ -35,7 +37,6 @@ #include <svx/ruler.hxx> #include <svl/zforlist.hxx> #include <svl/stritem.hxx> -#include <unotools/undoopt.hxx> #include "swtypes.hxx" #include "cmdid.h" @@ -74,7 +75,6 @@ SwInputWindow::SwInputWindow( Window* pParent, SfxBindings* pBind ) pView(0), pBindings(pBind), aAktTableName(aEmptyStr) - , m_nActionCount(0) , m_bDoesUndo(true) , m_bResetUndo(false) , m_bCallUndo(false) @@ -158,10 +158,6 @@ void SwInputWindow::CleanupUglyHackWithUndo() { pWrtShell->Undo(); } - if (0 == m_nActionCount) - { - SW_MOD()->GetUndoOptions().SetUndoCount(0); - } m_bResetUndo = false; // #i117122# once is enough :) } } @@ -246,10 +242,10 @@ void SwInputWindow::ShowWin() if( bIsTable ) { m_bResetUndo = true; - m_nActionCount = SW_MOD()->GetUndoOptions().GetUndoCount(); - if (0 == m_nActionCount) { // deactivated? turn it on... - SW_MOD()->GetUndoOptions().SetUndoCount(1); - } + SAL_WARN_IF( + officecfg::Office::Common::Undo::Steps::get( + comphelper::getProcessComponentContext()) <= 0, + "sw", "/org.openoffice.Office.Common/Undo/Steps <= 0"); m_bDoesUndo = pWrtShell->DoesUndo(); if( !m_bDoesUndo ) diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 738758f9296d..0b10a46f44bf 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -31,12 +31,13 @@ #include <stdlib.h> #include <hintids.hxx> #include <comphelper/string.hxx> +#include <comphelper/processfactory.hxx> +#include <officecfg/Office/Common.hxx> #include <rtl/logfile.hxx> #include <vcl/graph.hxx> #include <vcl/inputctx.hxx> #include <basic/sbxobj.hxx> #include <svl/eitem.hxx> -#include <unotools/undoopt.hxx> #include <unotools/lingucfg.hxx> #include <unotools/useroptions.hxx> #include <sfx2/dispatch.hxx> @@ -946,7 +947,11 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) !pDocSh->GetVisArea(ASPECT_CONTENT).IsEmpty() ) SetVisArea( pDocSh->GetVisArea(ASPECT_CONTENT),sal_False); - pWrtShell->DoUndo( 0 != SW_MOD()->GetUndoOptions().GetUndoCount() ); + SAL_WARN_IF( + officecfg::Office::Common::Undo::Steps::get( + comphelper::getProcessComponentContext()) <= 0, + "sw", "/org.openoffice.Office.Common/Undo/Steps <= 0"); + pWrtShell->DoUndo( true ); const sal_Bool bBrowse = pWrtShell->GetViewOptions()->getBrowseMode(); // Disable "multiple window" |