summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-06-30 12:39:26 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-04 12:30:12 +0200
commit0755d19069403ef16f55326c3a567ddf84d4d9ec (patch)
tree0002982b3c94c5e2d293b2aa5887dba853661f32
parentd95ac92b8530b0a48b468862b722daa88215228e (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 (cherry picked from commit 495284716f49072e432b8425944cc67dfe0df0e0) Reviewed-on: https://gerrit.libreoffice.org/39417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 799c2cfaa907..a764938d2d69 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();