Blob Blame History Raw
From f5dce79d272b47886f16a422f985ee250d228649 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Fri, 27 Jan 2012 14:58:19 +0100
Subject: [PATCH] Do not move nCurUndoAction < 0.

(Could easily happen when max undo steps is set to 1.)

Signed-off-by: Michael Meeks <michael.meeks@suse.com>
---
 svl/source/undo/undo.cxx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index e3b8cd1..e61d695 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -658,7 +658,10 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT
         {
             i_guard.markForDeletion( m_pData->pActUndoArray->aUndoActions[0].pAction );
             m_pData->pActUndoArray->aUndoActions.Remove(0);
-            --m_pData->pActUndoArray->nCurUndoAction;
+            if (m_pData->pActUndoArray->nCurUndoAction > 0)
+            {
+                --m_pData->pActUndoArray->nCurUndoAction;
+            }
         }
     }
 
-- 
1.7.11.7