[Libreoffice-commits] .: Branch 'libreoffice-3-5' - svl/source

Ivan Timofeev ivantimofeev at kemper.freedesktop.org
Thu Jun 28 03:06:32 PDT 2012


 svl/source/undo/undo.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit af18adbad7de00a7b0b1eda659ec6552a760556d
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Thu Jun 28 13:12:56 2012 +0400

    i#119400 repair broken undo
    
    (cherry picked from commit 1eed4c837828c00dff4ef0b2cf29b1e2962e912d)
    
    Change-Id: I36d74fe1555bd436f93a5fa595e7da05bbd37493
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index b3bd440..e3b8cd1 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -635,10 +635,14 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT
     // merge, if required
     SfxUndoAction* pMergeWithAction = m_pData->pActUndoArray->nCurUndoAction ?
         m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction-1].pAction : NULL;
-    if ( bTryMerge && ( !pMergeWithAction || !pMergeWithAction->Merge( pAction ) ) )
+    if ( bTryMerge && pMergeWithAction )
     {
-        i_guard.markForDeletion( pAction );
-        return false;
+        bool bMerged = pMergeWithAction->Merge( pAction );
+        if ( bMerged )
+        {
+            i_guard.markForDeletion( pAction );
+            return false;
+        }
     }
 
     // clear redo stack, if requested


More information about the Libreoffice-commits mailing list