[Libreoffice-commits] core.git: sw/source

Michael Stahl mstahl at redhat.com
Thu Jun 29 13:27:34 UTC 2017


 sw/source/core/edit/edws.cxx     |    7 ++++++-
 sw/source/uibase/uiview/view.cxx |    5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 5c4a9dfdc01606e0a35c5e2809571d0f6f03df39
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jun 29 15:04:04 2017 +0200

    tdf#108836 sw: don't enable Undo if Steps configured to 0
    
    It doesn't work.
    
    Change-Id: Iafc3eb50f481faffee60592aa3b6fd2ed4387b90

diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx
index 685c37c7ec56..13edb1325851 100644
--- a/sw/source/core/edit/edws.cxx
+++ b/sw/source/core/edit/edws.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <officecfg/Office/Common.hxx>
+
 #include <vcl/window.hxx>
 
 #include <editsh.hxx>
@@ -40,7 +42,10 @@ SwEditShell::SwEditShell( SwEditShell& rEdSH, vcl::Window *pWindow )
 SwEditShell::SwEditShell( SwDoc& rDoc, vcl::Window *pWindow, const SwViewOption *pOptions )
     : SwCursorShell( rDoc, pWindow, pOptions )
 {
-    GetDoc()->GetIDocumentUndoRedo().DoUndo(true);
+    if (0 < officecfg::Office::Common::Undo::Steps::get())
+    {
+        GetDoc()->GetIDocumentUndoRedo().DoUndo(true);
+    }
 }
 
 SwEditShell::~SwEditShell() // USED
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index f3e235099d69..fa2693e8a1d0 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -904,7 +904,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
     SAL_WARN_IF(
         officecfg::Office::Common::Undo::Steps::get() <= 0,
         "sw.ui", "/org.openoffice.Office.Common/Undo/Steps <= 0");
-    m_pWrtShell->DoUndo();
+    if (0 < officecfg::Office::Common::Undo::Steps::get())
+    {
+        m_pWrtShell->DoUndo();
+    }
 
     const bool bBrowse = m_pWrtShell->GetViewOptions()->getBrowseMode();
     // Disable "multiple window"


More information about the Libreoffice-commits mailing list