[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue May 3 14:23:11 PDT 2011


 sc/source/core/data/document.cxx |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

New commits:
commit 89024286750f1df62b0a687860eb08567e76422d
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue May 3 17:22:28 2011 -0400

    Simplify the code a bit.

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 6370b66..3e86a75 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -5427,16 +5427,8 @@ void ScDocument::EnableUndo( bool bVal )
     // enabled, or else re-enabling it may not actually re-enable undo unless
     // the lock count becomes zero.
 
-    if (bVal)
-    {
-        if (!GetUndoManager()->IsUndoEnabled())
-            GetUndoManager()->EnableUndo(true);
-    }
-    else
-    {
-        if (GetUndoManager()->IsUndoEnabled())
-            GetUndoManager()->EnableUndo(false);
-    }
+    if (bVal != GetUndoManager()->IsUndoEnabled())
+        GetUndoManager()->EnableUndo(bVal);
 
     mbUndoEnabled = bVal;
 }


More information about the Libreoffice-commits mailing list