summaryrefslogtreecommitdiff
path: root/svl/source/undo/undo.cxx
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-10-22 23:22:52 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-10-22 23:22:52 +0200
commit271bddee301b0b04056719b94835bb3742cd0729 (patch)
tree85a7af38676510a779443f2db0ab1d999c031226 /svl/source/undo/undo.cxx
parentd0d55eecb15f9a72107d9058e431c2e97b127f85 (diff)
undoapi: yet more Undo API tests (will this ever end?)
Diffstat (limited to 'svl/source/undo/undo.cxx')
-rw-r--r--svl/source/undo/undo.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index d95a5ea5f925..67e05304c869 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -494,8 +494,10 @@ BOOL SfxUndoManager::Undo()
DBG_ASSERT( m_pData->pActUndoArray == m_pData->pUndoArray, "svl::SfxUndoManager::Undo(), LeaveListAction() not yet called!" );
if ( m_pData->pActUndoArray->nCurUndoAction )
{
- SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ --m_pData->pActUndoArray->nCurUndoAction ];
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[ m_pData->pActUndoArray->nCurUndoAction - 1 ];
pAction->Undo();
+ // decrement nCurUndoAction *after* having called Undo - in case it raises an exception
+ --m_pData->pActUndoArray->nCurUndoAction;
bRet = TRUE;
for ( UndoListeners::const_iterator listener = m_pData->aListeners.begin();
@@ -538,8 +540,10 @@ BOOL SfxUndoManager::Redo()
if ( m_pData->pActUndoArray->aUndoActions.Count() > m_pData->pActUndoArray->nCurUndoAction )
{
- SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction++];
+ SfxUndoAction* pAction = m_pData->pActUndoArray->aUndoActions[m_pData->pActUndoArray->nCurUndoAction];
pAction->Redo();
+ // increment nCurUndoAction *after* having called Redo - in case it raises an exception
+ ++m_pData->pActUndoArray->nCurUndoAction;
bRet = TRUE;
for ( UndoListeners::const_iterator listener = m_pData->aListeners.begin();