From 495284716f49072e432b8425944cc67dfe0df0e0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 30 Jun 2017 12:39:26 +0200 Subject: 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 --- sd/source/ui/docshell/docshell.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sd/source/ui/docshell/docshell.cxx') 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 + +#include + #include #include @@ -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(); -- cgit v1.2.3