summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2013-06-26 12:15:55 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-06-26 16:22:38 +0100
commit25d84e2826de81d1e7a55ff0fdab7845b7a78e74 (patch)
tree904e93931dd60504341c9a710aad5140784222da /svl
parent19694e844942d44d2c2d5e1d1b95b49d03916573 (diff)
Resolves: #i121751# restore cursor/selection on Undo/Redo language...
change for all text - group intrinsic actions of language change for all text into one Undo action - secure <SwRootFrm::CalcRects(..)> - catch NULL pointer - correct <CursorGuard> - really restore the cursor (cherry picked from commit 4207db473430e02a65a5f4d57db6e46a8db29a19) Conflicts: svl/inc/svl/undo.hxx svl/source/undo/undo.cxx sw/inc/IDocumentUndoRedo.hxx sw/source/core/edit/edundo.cxx sw/source/core/inc/UndoManager.hxx sw/source/core/layout/trvlfrm.cxx sw/source/core/undo/docundo.cxx Change-Id: I972988bbc21a519e0956ff196aa93a46287b9a2e
Diffstat (limited to 'svl')
-rw-r--r--svl/source/undo/undo.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index dac5dc3d37dc..d27de22e266e 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -830,11 +830,30 @@ size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel )
//------------------------------------------------------------------------
+SfxUndoAction* SfxUndoManager::GetRedoAction( size_t nNo, bool const i_currentLevel ) const
+{
+ UndoManagerGuard aGuard( *m_pData );
+
+ const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
+ if ( (pUndoArray->nCurUndoAction + nNo) > pUndoArray->aUndoActions.size() )
+ {
+ return NULL;
+ }
+ return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction;
+}
+
+//------------------------------------------------------------------------
+
OUString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const
{
+ String sComment;
UndoManagerGuard aGuard( *m_pData );
const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
- return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction->GetComment();
+ if ( (pUndoArray->nCurUndoAction + nNo) < pUndoArray->aUndoActions.size() )
+ {
+ sComment = pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction->GetComment();
+ }
+ return sComment;
}
//------------------------------------------------------------------------