summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-01-27 14:58:19 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-10-01 10:11:28 +0100
commitf5dce79d272b47886f16a422f985ee250d228649 (patch)
treec7ce3ce1cbea3550d7973fa7a8a86f1765196e69
parentc44c58be34ae09f4585689b44b04ebd5fc144252 (diff)
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>
-rw-r--r--svl/source/undo/undo.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index e3b8cd1812cb..e61d695dc3d1 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;
+ }
}
}