i#119400 repair broken undo

Change-Id: I36d74fe1555bd436f93a5fa595e7da05bbd37493
This commit is contained in:
Ivan Timofeev
2012-06-28 13:12:56 +04:00
parent b4fae02946
commit 1eed4c8378

View File

@@ -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