diff options
author | Carsten Driesner <cd@openoffice.org> | 2011-02-07 13:06:08 +0100 |
---|---|---|
committer | Carsten Driesner <cd@openoffice.org> | 2011-02-07 13:06:08 +0100 |
commit | dde0ca60a7619e03c7ed5a4ddacfb048dd159ab7 (patch) | |
tree | 66e5a71ff830f75382ce388b33021db01c3fd4c4 /sd/source/core | |
parent | c64664f9e281980106741fc759d2faa190009b22 (diff) | |
parent | 1a0a7970636e093d015267b828ecd8d5c2543541 (diff) |
removetooltypes01: Rebase to DEV300m99
Diffstat (limited to 'sd/source/core')
-rwxr-xr-x | sd/source/core/drawdoc3.cxx | 6 | ||||
-rwxr-xr-x | sd/source/core/sdpage.cxx | 26 | ||||
-rwxr-xr-x | sd/source/core/undo/undomanager.cxx | 41 |
3 files changed, 20 insertions, 53 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 7a74c082f7ec..a407d44251a5 100755 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -535,7 +535,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage( |* den Seiten transferieren, sonst verlieren die Textobjekte |* beim Transfer den Bezug zur Vorlage \*************************************************************************/ - SfxUndoManager* pUndoMgr = NULL; + ::svl::IUndoManager* pUndoMgr = NULL; if( mpDocSh ) { pUndoMgr = mpDocSh->GetUndoManager(); @@ -1356,7 +1356,7 @@ SvStream* SdDrawDocument::GetDocumentStream(SdrDocumentStreamInfo& rStreamInfo) void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool bOnlyDuplicatePages, sal_Bool bUndo) { ::sd::View* pView = NULL; - SfxUndoManager* pUndoMgr = NULL; + ::svl::IUndoManager* pUndoMgr = NULL; if( bUndo && !IsUndoEnabled() ) bUndo = sal_False; @@ -1525,7 +1525,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, if( mpDocSh ) mpDocSh->SetWaitCursor( sal_True ); - SfxUndoManager* pUndoMgr = mpDocSh->GetUndoManager(); + ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager(); const bool bUndo = IsUndoEnabled(); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 7b54e1ce361e..879f5505b8cc 100755 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -251,8 +251,8 @@ void SdPage::EnsureMasterPageDefaultBackground() */ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const Rectangle& rRect, sal_Bool /* bInsert */ ) { - sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); SdrObject* pSdrObj = NULL; @@ -716,10 +716,10 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang { if( pObj->GetUserCall() ) { - sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); /* - DBG_ASSERT( bUndo || (pUndoManager && pUndoManager->isInUndo()), + DBG_ASSERT( bUndo || (pUndoManager && pUndoManager->IsDoing()), "SdPage::Changed(), model change without undo!?" ); */ if( bUndo ) @@ -767,8 +767,8 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang void SdPage::CreateTitleAndLayout(sal_Bool bInit, sal_Bool bCreate ) { - sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); SdPage* pMasterPage = this; @@ -1554,8 +1554,8 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, sal_Bool bInit, sal_Bool bCreate const bool bSwitchLayout = eLayout != GetAutoLayout(); - sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); meAutoLayout = eLayout; @@ -2112,8 +2112,8 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, if( !pModel || !pSourceObj ) return pSourceObj; - sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && rPage.IsInserted(); + ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && rPage.IsInserted(); SdrObject* pNewObj = pSourceObj; if((eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() == OBJ_TEXT) ) @@ -2252,8 +2252,8 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, */ SdrObject* SdPage::InsertAutoLayoutShape( SdrObject* pObj, PresObjKind eObjKind, bool bVertical, Rectangle aRect, bool bInit ) { - sd::UndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + ::svl::IUndoManager* pUndoManager = pModel ? static_cast<SdDrawDocument*>(pModel)->GetUndoManager() : 0; + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); if (!pObj && bInit) { diff --git a/sd/source/core/undo/undomanager.cxx b/sd/source/core/undo/undomanager.cxx index 5b7ed22e3a9e..37f4ebe75dfa 100755 --- a/sd/source/core/undo/undomanager.cxx +++ b/sd/source/core/undo/undomanager.cxx @@ -34,40 +34,22 @@ using namespace sd; UndoManager::UndoManager( sal_uInt16 nMaxUndoActionCount /* = 20 */ ) : SfxUndoManager( nMaxUndoActionCount ) -, mnListLevel( 0 ) , mpLinkedUndoManager(NULL) { } void UndoManager::EnterListAction(const UniString &rComment, const UniString& rRepeatComment, sal_uInt16 nId /* =0 */) { - if( !isInUndo() ) + if( !IsDoing() ) { ClearLinkedRedoActions(); - mnListLevel++; SfxUndoManager::EnterListAction( rComment, rRepeatComment, nId ); } } -void UndoManager::LeaveListAction() +void UndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg /* = FALSE */ ) { - if( !isInUndo() ) - { - SfxUndoManager::LeaveListAction(); - if( mnListLevel ) - { - mnListLevel--; - } - else - { - DBG_ERROR("sd::UndoManager::LeaveListAction(), no open list action!" ); - } - } -} - -void UndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg /* = sal_False */ ) -{ - if( !isInUndo() ) + if( !IsDoing() ) { ClearLinkedRedoActions(); SfxUndoManager::AddUndoAction( pAction, bTryMerg ); @@ -79,22 +61,7 @@ void UndoManager::AddUndoAction( SfxUndoAction *pAction, sal_Bool bTryMerg /* = } -sal_Bool UndoManager::Undo( sal_uInt16 nCount ) -{ - ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Undo( nCount ); -} - -sal_Bool UndoManager::Redo( sal_uInt16 nCount ) -{ - ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Redo( nCount ); -} - - - - -void UndoManager::SetLinkedUndoManager (SfxUndoManager* pLinkedUndoManager) +void UndoManager::SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager) { mpLinkedUndoManager = pLinkedUndoManager; } |