summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-01-27 15:03:39 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-01-27 15:04:26 +0100
commit452d86c9cbfb6b4b7e86426931a0d982dd8bb180 (patch)
tree4f80b7cc380d731c71f566ee7e91b2e300126360 /sfx2
parentdb59e4481614f58e111a86a1926e49fb523ebbae (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 'sfx2')
-rw-r--r--sfx2/source/appl/app.cxx1
-rw-r--r--sfx2/source/appl/appbas.cxx16
-rw-r--r--sfx2/source/appl/appcfg.cxx18
-rw-r--r--sfx2/source/appl/appdata.cxx1
-rw-r--r--sfx2/source/control/shell.cxx8
-rw-r--r--sfx2/source/inc/appdata.hxx2
6 files changed, 29 insertions, 17 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 7e29777fa6b6..6cae96159f63 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -113,7 +113,6 @@
#endif
#include <unotools/saveopt.hxx>
-#include <unotools/undoopt.hxx>
#include <svtools/helpopt.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/viewoptions.hxx>
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 1f28ec8b0344..660f9a1ae524 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -31,6 +31,7 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/uno/Reference.h>
#include <basic/basrdll.hxx>
+#include <officecfg/Office/Common.hxx>
#include <svl/macitem.hxx>
#include <basic/sbxfac.hxx>
#include <basic/sbx.hxx>
@@ -48,7 +49,6 @@
#include <svtools/sfxecode.hxx>
#include <svtools/ehdl.hxx>
-#include <unotools/undoopt.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/bootstrap.hxx>
@@ -182,7 +182,13 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq )
case SID_ATTR_UNDO_COUNT:
{
SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID, sal_False);
- SvtUndoOptions().SetUndoCount( pCountItem->GetValue() );
+ boost::shared_ptr< unotools::ConfigurationChanges > batch(
+ unotools::ConfigurationChanges::create(
+ comphelper::getProcessComponentContext()));
+ officecfg::Office::Common::Undo::Steps::set(
+ comphelper::getProcessComponentContext(), batch,
+ pCountItem->GetValue());
+ batch->commit();
break;
}
@@ -245,7 +251,11 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet )
break;
case SID_ATTR_UNDO_COUNT:
- rSet.Put( SfxUInt16Item( SID_ATTR_UNDO_COUNT, sal::static_int_cast< sal_uInt16 >( SvtUndoOptions().GetUndoCount() ) ) );
+ rSet.Put(
+ SfxUInt16Item(
+ SID_ATTR_UNDO_COUNT,
+ officecfg::Office::Common::Undo::Steps::get(
+ comphelper::getProcessComponentContext())));
break;
case SID_UPDATE_VERSION:
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index cd91d40f98b2..25ff74c2b866 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -52,11 +52,11 @@
#include <svl/isethint.hxx>
#include <officecfg/Inet.hxx>
+#include <officecfg/Office/Common.hxx>
#include <unotools/configmgr.hxx>
#include <tools/urlobj.hxx>
#include <unotools/saveopt.hxx>
#include <svtools/helpopt.hxx>
-#include <unotools/undoopt.hxx>
#include <unotools/securityoptions.hxx>
#include <unotools/pathoptions.hxx>
#include <svtools/miscopt.hxx>
@@ -169,7 +169,6 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
const sal_uInt16 *pRanges = rSet.GetRanges();
SvtSaveOptions aSaveOptions;
- SvtUndoOptions aUndoOptions;
SvtHelpOptions aHelpOptions;
SvtSecurityOptions aSecurityOptions;
SvtMiscOptions aMiscOptions;
@@ -296,9 +295,14 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
bRet = sal_True;
break;
case SID_ATTR_UNDO_COUNT :
- if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_ATTR_UNDO_COUNT ),
- (sal_uInt16)aUndoOptions.GetUndoCount() ) ) )
- bRet = sal_True;
+ if (rSet.Put(
+ SfxUInt16Item (
+ rPool.GetWhich(SID_ATTR_UNDO_COUNT),
+ officecfg::Office::Common::Undo::Steps::get(
+ comphelper::getProcessComponentContext()))))
+ {
+ bRet = true;
+ }
break;
case SID_ATTR_QUICKLAUNCHER :
{
@@ -531,7 +535,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
SfxItemPool &rPool = GetPool();
SvtSaveOptions aSaveOptions;
- SvtUndoOptions aUndoOptions;
SvtHelpOptions aHelpOptions;
SvtSecurityOptions aSecurityOptions;
SvtPathOptions aPathOptions;
@@ -703,7 +706,8 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
{
DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue();
- aUndoOptions.SetUndoCount( nUndoCount );
+ officecfg::Office::Common::Undo::Steps::set(
+ comphelper::getProcessComponentContext(), batch, nUndoCount);
// To catch all Undo-Managers: Iterate over all Frames
for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst();
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 182ed413b557..0358dd4a19c6 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -103,7 +103,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* )
, pPool(0)
, pDisabledSlotList( 0 )
, pSaveOptions( 0 )
- , pUndoOptions( 0 )
, pHelpOptions( 0 )
, pProgress(0)
, pTemplateCommon( 0 )
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 74ce18457c3e..de879755459e 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -28,7 +28,9 @@
#include <com/sun/star/embed/VerbDescriptor.hpp>
#include <com/sun/star/embed/VerbAttributes.hpp>
+#include <comphelper/processfactory.hxx>
#include <basic/sbstar.hxx>
+#include <officecfg/Office/Common.hxx>
#include <rtl/oustringostreaminserter.hxx>
#include <sal/log.hxx>
#include <svl/itempool.hxx>
@@ -37,8 +39,6 @@
#include <svtools/asynclink.hxx>
#include <basic/sbx.hxx>
-#include <unotools/undoopt.hxx>
-
#include <sfx2/app.hxx>
#include <sfx2/shell.hxx>
#include <sfx2/bindings.hxx>
@@ -486,7 +486,9 @@ void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr )
pUndoMgr = pNewUndoMgr;
if ( pUndoMgr )
- pUndoMgr->SetMaxUndoActionCount( (sal_uInt16) SvtUndoOptions().GetUndoCount() );
+ pUndoMgr->SetMaxUndoActionCount(
+ officecfg::Office::Common::Undo::Steps::get(
+ comphelper::getProcessComponentContext()));
}
//--------------------------------------------------------------------
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 96a31180a0fc..938773027d1c 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -55,7 +55,6 @@ class SfxDdeTriggerTopic_Impl;
class SfxDocumentTemplates;
class SfxFrameArr_Impl;
class SvtSaveOptions;
-class SvtUndoOptions;
class SvtHelpOptions;
class SfxObjectFactory;
class SfxObjectShell;
@@ -115,7 +114,6 @@ public:
SfxItemPool* pPool;
std::vector<sal_uInt16>* pDisabledSlotList;
SvtSaveOptions* pSaveOptions;
- SvtUndoOptions* pUndoOptions;
SvtHelpOptions* pHelpOptions;
// "current" functionality