summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-06-30 12:39:26 +0200
committerMichael Stahl <mstahl@redhat.com>2017-06-30 17:14:56 +0200
commit495284716f49072e432b8425944cc67dfe0df0e0 (patch)
tree36759d86854e662ecbecdc6a51e62994a775a03d
parentab3268d47b892a4dd4aba4cd5b3d02974157f70a (diff)
tdf#108863 sd: disable Undo earlier if no Undo Steps
If 0 Undo Steps, the Undo is disabled by a timer somewhere calling SfxShell::SetUndoManager(). This seems a bit risky, so disable it already when the sd::UndoManager is created. Change-Id: I9caf14fe32251d1f92cb5fa0683838316275eab3
-rw-r--r--sd/source/ui/docshell/docshell.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index fa35e3a9808b..1ae312469225 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -18,6 +18,11 @@
*/
#include "DrawDocShell.hxx"
+
+#include <officecfg/Office/Common.hxx>
+
+#include <unotools/configmgr.hxx>
+
#include <vcl/svapp.hxx>
#include <sfx2/docfac.hxx>
@@ -108,6 +113,11 @@ void DrawDocShell::Construct( bool bClipboard )
SetBaseModel( new SdXImpressDocument( this, bClipboard ) );
SetPool( &mpDoc->GetItemPool() );
mpUndoManager = new sd::UndoManager;
+ if (!utl::ConfigManager::IsAvoidConfig()
+ && officecfg::Office::Common::Undo::Steps::get() < 1)
+ {
+ mpUndoManager->EnableUndo(false); // tdf#108863 disable if 0 steps
+ }
mpDoc->SetSdrUndoManager( mpUndoManager );
mpDoc->SetSdrUndoFactory( new sd::UndoFactory );
UpdateTablePointers();