summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-01-27 14:58:19 +0100
committerStephan Bergmann <sbergman@redhat.com>2012-01-27 15:04:26 +0100
commitdb59e4481614f58e111a86a1926e49fb523ebbae (patch)
tree90d7e1517edd4a5462478b51430e878bf67174d3
parentCppunitTest_sal_osl_file fails on Windows (diff)
downloadcore-db59e4481614f58e111a86a1926e49fb523ebbae.tar.gz
core-db59e4481614f58e111a86a1926e49fb523ebbae.zip
Do not move nCurUndoAction < 0.
(Could easily happen when max undo steps is set to 1.)
-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 b3bd44099631..449b79a89e9d 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -654,7 +654,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;
+ }
}
}