diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-06-29 15:04:04 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-07-04 12:32:49 +0200 |
commit | 55368a0602eb2ab191e969d3b363087dce62994f (patch) | |
tree | a5f9abe376b09161d602be5c450b1a93c889c9eb | |
parent | c6640f93273475b6d686f14820051cbfa4b1b6c2 (diff) |
tdf#108836 sw: don't enable Undo if Steps configured to 0
It doesn't work.
Change-Id: Iafc3eb50f481faffee60592aa3b6fd2ed4387b90
(cherry picked from commit 5c4a9dfdc01606e0a35c5e2809571d0f6f03df39)
Reviewed-on: https://gerrit.libreoffice.org/39390
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/source/core/edit/edws.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index cbda86ddf3eb..ab99d1eebf8f 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 8cc9b2438f62..a9edfaf86e00 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -907,7 +907,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" |