undo.cxx (01300968) undo.cxx (89358e0f)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 817 unchanged lines hidden (view full) ---

826size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel ) const
827{
828 const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
829 return pUndoArray->aUndoActions.size() - pUndoArray->nCurUndoAction;
830}
831
832//------------------------------------------------------------------------
833
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 817 unchanged lines hidden (view full) ---

826size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel ) const
827{
828 const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
829 return pUndoArray->aUndoActions.size() - pUndoArray->nCurUndoAction;
830}
831
832//------------------------------------------------------------------------
833
834SfxUndoAction* SfxUndoManager::GetRedoAction( size_t nNo, bool const i_currentLevel ) const
835{
836 UndoManagerGuard aGuard( *m_pData );
837
838 const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
839 if ( (pUndoArray->nCurUndoAction + nNo) > pUndoArray->aUndoActions.size() )
840 {
841 return NULL;
842 }
843 return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction;
844}
845
846//------------------------------------------------------------------------
847
834XubString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const
835{
848XubString SfxUndoManager::GetRedoActionComment( size_t nNo, bool const i_currentLevel ) const
849{
850 String sComment;
836 UndoManagerGuard aGuard( *m_pData );
837 const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
851 UndoManagerGuard aGuard( *m_pData );
852 const SfxUndoArray* pUndoArray = i_currentLevel ? m_pData->pActUndoArray : m_pData->pUndoArray;
838 return pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction->GetComment();
853 if ( (pUndoArray->nCurUndoAction + nNo) < pUndoArray->aUndoActions.size() )
854 {
855 sComment = pUndoArray->aUndoActions[ pUndoArray->nCurUndoAction + nNo ].pAction->GetComment();
856 }
857 return sComment;
839}
840
841//------------------------------------------------------------------------
842
843sal_Bool SfxUndoManager::Redo()
844{
845 return ImplRedo( NULL );
846}

--- 643 unchanged lines hidden ---
858}
859
860//------------------------------------------------------------------------
861
862sal_Bool SfxUndoManager::Redo()
863{
864 return ImplRedo( NULL );
865}

--- 643 unchanged lines hidden ---