summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/appcfg.cxx
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/source/appl/appcfg.cxx
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/source/appl/appcfg.cxx')
-rw-r--r--sfx2/source/appl/appcfg.cxx18
1 files changed, 11 insertions, 7 deletions
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();