[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sd/source

Michael Stahl mstahl at redhat.com
Tue Jul 4 10:30:37 UTC 2017


 sd/source/ui/docshell/docshell.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 0755d19069403ef16f55326c3a567ddf84d4d9ec
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Jun 30 12:39:26 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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();


More information about the Libreoffice-commits mailing list