diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2011-01-28 11:59:17 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2011-01-28 11:59:17 +0100 |
commit | 72f5fa42bf79980db5563cf263bee057c1a27f61 (patch) | |
tree | 820b8b4f680746f635b86f2691d9c381acaeb2e9 /sd/source | |
parent | 4de9a23946e04a56481be4110fe568f51728dee6 (diff) | |
parent | 5371ef1933f116e28cc475fd027f07e8937ebdcc (diff) |
CWS-TOOLING: integrate CWS undoapi
Diffstat (limited to 'sd/source')
28 files changed, 112 insertions, 248 deletions
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index aee3e7a9c..264293cae 100755 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -535,7 +535,7 @@ 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, BOOL bOnlyDuplicatePages, BOOL bUndo) { ::sd::View* pView = NULL; - SfxUndoManager* pUndoMgr = NULL; + ::svl::IUndoManager* pUndoMgr = NULL; if( bUndo && !IsUndoEnabled() ) bUndo = FALSE; @@ -1525,7 +1525,7 @@ void SdDrawDocument::SetMasterPage(USHORT nSdPageNum, if( mpDocSh ) mpDocSh->SetWaitCursor( 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 41ef9982f..aee572263 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, BOOL bVertical, const Rectangle& rRect, 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(BOOL bInit, 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, BOOL bInit, 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 ecb36ef07..bab3ad285 100644..100755 --- a/sd/source/core/undo/undomanager.cxx +++ b/sd/source/core/undo/undomanager.cxx @@ -34,40 +34,22 @@ using namespace sd; UndoManager::UndoManager( USHORT nMaxUndoActionCount /* = 20 */ ) : SfxUndoManager( nMaxUndoActionCount ) -, mnListLevel( 0 ) , mpLinkedUndoManager(NULL) { } void UndoManager::EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId /* =0 */) { - if( !isInUndo() ) + if( !IsDoing() ) { ClearLinkedRedoActions(); - mnListLevel++; SfxUndoManager::EnterListAction( rComment, rRepeatComment, nId ); } } -void UndoManager::LeaveListAction() -{ - if( !isInUndo() ) - { - SfxUndoManager::LeaveListAction(); - if( mnListLevel ) - { - mnListLevel--; - } - else - { - DBG_ERROR("sd::UndoManager::LeaveListAction(), no open list action!" ); - } - } -} - void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALSE */ ) { - if( !isInUndo() ) + if( !IsDoing() ) { ClearLinkedRedoActions(); SfxUndoManager::AddUndoAction( pAction, bTryMerg ); @@ -79,22 +61,7 @@ void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALS } -BOOL UndoManager::Undo( USHORT nCount ) -{ - ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Undo( nCount ); -} - -BOOL UndoManager::Redo( USHORT nCount ) -{ - ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Redo( nCount ); -} - - - - -void UndoManager::SetLinkedUndoManager (SfxUndoManager* pLinkedUndoManager) +void UndoManager::SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager) { mpLinkedUndoManager = pLinkedUndoManager; } diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index d6696e624..f9a62e842 100755 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -289,7 +289,7 @@ CustomAnimationPane::~CustomAnimationPane() void CustomAnimationPane::addUndo() { - SfxUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager(); + ::svl::IUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager(); if( pManager ) { SdPage* pPage = SdPage::getImplementation( mxCurrentPage ); @@ -2461,7 +2461,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot CustomAnimationEffectPtr pEffect = xTag->getEffect(); if( (pPathObj != 0) && pEffect.get() != 0 ) { - SfxUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager(); + ::svl::IUndoManager* pManager = mrBase.GetDocShell()->GetUndoManager(); if( pManager ) { SdPage* pPage = SdPage::getImplementation( mxCurrentPage ); diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 182fe67db..20c79aacc 100755 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -265,9 +265,9 @@ void lcl_CreateUndoForPages( const ::sd::slidesorter::SharedPageSelection& rpPages, ::sd::ViewShellBase& rBase ) { - ::sd::DrawDocShell* pDocSh = rBase.GetDocShell(); - SfxUndoManager* pManager = pDocSh->GetUndoManager(); - SdDrawDocument* pDoc = pDocSh->GetDoc(); + ::sd::DrawDocShell* pDocSh = rBase.GetDocShell(); + ::svl::IUndoManager* pManager = pDocSh->GetUndoManager(); + SdDrawDocument* pDoc = pDocSh->GetDoc(); if( pManager && pDocSh && pDoc ) { String aComment( SdResId(STR_UNDO_SLIDE_PARAMS) ); diff --git a/sd/source/ui/app/app.img b/sd/source/ui/app/app.img deleted file mode 100644 index a435b84b8..000000000 --- a/sd/source/ui/app/app.img +++ /dev/null @@ -1,120 +0,0 @@ -File = "sc05410.bmp";Identifier = SID_HELPMENU; -File = "sc05500.bmp";Identifier = SID_NEW_DOCUMENT;File = "sco043.bmp -File = "sc05501.bmp";Identifier = SID_OPENDOC;File = "sco044.bmp -File = "sc05504.bmp";Identifier = SID_PRINTDOC;File = "sco051.bmp -File = "sc05505.bmp";Identifier = SID_SAVEDOC;File = "sco046.bmp -File = "sc05539.bmp";Identifier = SID_TEMPLATE; -File = "sc05561.bmp";Identifier = SID_INSERT_OBJECT; -File = "sc05700.bmp";Identifier = SID_REDO; -File = "sc05701.bmp";Identifier = SID_UNDO; -File = "sc05710.bmp";Identifier = SID_CUT;File = "sco058.bmp -File = "sc05711.bmp";Identifier = SID_COPY;File = "sco059.bmp -File = "sc05712.bmp";Identifier = SID_PASTE;File = "sco060.bmp - -File = "sc10008.bmp";Identifier = SID_ATTR_CHAR_POSTURE; -File = "sc10009.bmp";Identifier = SID_ATTR_CHAR_WEIGHT; -File = "sc10012.bmp";Identifier = SID_ATTR_CHAR_CONTOUR; -File = "sc10014.bmp";Identifier = SID_ATTR_CHAR_UNDERLINE; -File = "sc10028.bmp";Identifier = SID_TEXT_ADJUST_LEFT; -File = "sc10029.bmp";Identifier = SID_TEXT_ADJUST_RIGHT; -File = "sc10030.bmp";Identifier = SID_TEXT_ADJUST_CENTER; -File = "sc10031.bmp";Identifier = SID_TEXT_ADJUST_BLOCK; -File = "sc10034.bmp";Identifier = SID_TEXT_LINESPACING_1; -File = "sc10035.bmp";Identifier = SID_TEXT_LINESPACING_2; -File = "sc10036.bmp";Identifier = SID_TEXT_LINESPACING_3; -File = "sc10087.bmp";Identifier = SID_TRANSFORM; -File = "sc10102.bmp";Identifier = SID_TOOL_LINE;File = "sco207.bmp -File = "sc10104.bmp";Identifier = SID_TOOL_RECT;File = "sco209.bmp -File = "sc10110.bmp";Identifier = SID_TOOL_ELLIPSE;File = "sco215.bmp -File = "sc10113.bmp";Identifier = SID_TOOL_PIE;File = "sco220.bmp -File = "sc10114.bmp";Identifier = SID_TOOL_ARC;File = "sco217.bmp -File = "sc10116.bmp";Identifier = SID_TOOL_CIRCLECUT;File = "sco221.bmp -File = "sc10117.bmp";Identifier = SID_TOOL_POLYGON;File = "sco222.bmp -File = "sc10118.bmp";Identifier = SID_TOOL_BEZIER;File = "sco223.bmp -File = "sc10119.bmp";Identifier = SID_BEZIER_INSERT; -File = "sc10120.bmp";Identifier = SID_BEZIER_DELETE; -File = "sc10121.bmp";Identifier = SID_BEZIER_MOVE; -File = "sc10122.bmp";Identifier = SID_BEZIER_CLOSE; -// wurde durch sc20014.bmp ersetzt: -// File = "sc10123.bmp";Identifier = SID_BEZIER_SMOOTH; -File = "sc10126.bmp";Identifier = SID_EDIT_POINTS; -File = "sc10127.bmp";Identifier = SID_BEZIER_CUTLINE; -File = "sc10129.bmp";Identifier = SID_TOOL_ROTATE; -File = "sc10130.bmp";Identifier = SID_ALIGNMENT; -File = "sc10131.bmp";Identifier = SID_LEFT;File = "sco231.bmp -File = "sc10132.bmp";Identifier = SID_CENTER;File = "sco232.bmp -File = "sc10133.bmp";Identifier = SID_RIGHT;File = "sco233.bmp -File = "sc10134.bmp";Identifier = SID_UP;File = "sco234.bmp -File = "sc10135.bmp";Identifier = SID_MIDDLE;File = "sco235.bmp -File = "sc10136.bmp";Identifier = SID_DOWN;File = "sco236.bmp -File = "sc10140.bmp";Identifier = SID_INSERTDIAGRAM;File = "sco246.bmp -File = "sc10141.bmp";Identifier = SID_ATTR_TABLE; -File = "sc10142.bmp";Identifier = SID_AREA; -File = "sc10143.bmp";Identifier = SID_LINE; -File = "sc10144.bmp";Identifier = SID_TOOL_CONTROLS;File = "sco270.bmp -File = "sc10145.bmp";Identifier = SID_DIALOG_TESTMODE;File = "sco274.bmp -File = "sc10146.bmp";Identifier = SID_INSERT_PUSHBUTTON;File = "sco271.bmp -File = "sc10147.bmp";Identifier = SID_INSERT_RADIOBUTTON;File = "sco272.bmp -File = "sc10148.bmp";Identifier = SID_INSERT_CHECKBOX;File = "sco273.bmp -File = "sc10150.bmp";Identifier = SID_OUTLINE_UP;File = "sco290.bmp -File = "sc10151.bmp";Identifier = SID_OUTLINE_DOWN;File = "sco291.bmp -File = "sc10152.bmp";Identifier = SID_OUTLINE_LEFT;File = "sco292.bmp -File = "sc10153.bmp";Identifier = SID_OUTLINE_RIGHT;File = "sco293.bmp -File = "sc10154.bmp";Identifier = SID_OUTLINE_FORMAT;File = "sco204.bmp -File = "sc10155.bmp";Identifier = SID_OUTLINE_TITLE;File = "sco295.bmp -File = "sc10156.bmp";Identifier = SID_OUTLINE_BULLET;File = "sco296.bmp -File = "sc10157.bmp";Identifier = SID_PRESENTATION;File = "sco238.bmp -File = "sc10159.bmp";Identifier = SID_REHEARSE_TIMINGS;File = "sco239.bmp -File = "sc10160.bmp";Identifier = SID_DIA;File = "sco240.bmp -File = "sc10161.bmp";Identifier = SID_HIDE_SLIDE;File = "sco241.bmp -File = "sc10162.bmp";Identifier = SID_CHOOSE_POLYGON;File = "sco242.bmp -File = "sc10163.bmp";Identifier = SID_SHOW_BROWSER;File = "sco275.bmp -File = "sc10188.bmp";Identifier = SID_INSERT_FIXEDTEXT;File = "sco276.bmp -File = "sc10189.bmp";Identifier = SID_INSERT_GROUPBOX;File = "sco277.bmp -File = "sc10191.bmp";Identifier = SID_INSERT_LISTBOX;File = "sco278.bmp -File = "sc10192.bmp";Identifier = SID_INSERT_COMBOBOX;File = "sco279.bmp -File = "sc10231.bmp";Identifier = SID_OUTLINE_COLLAPSE; -File = "sc10232.bmp";Identifier = SID_OUTLINE_EXPAND_ALL; -File = "sc10233.bmp";Identifier = SID_OUTLINE_EXPAND; -File = "sc10240.bmp";Identifier = SID_INSERT_FRAME; -File = "sc10241.bmp";Identifier = SID_INSERT_GRAPHIC; -File = "sc10242.bmp";Identifier = SID_AUTOFORMAT; -File = "sc10243.bmp";Identifier = SID_SPELLING; -File = "sc10244.bmp";Identifier = SID_INSERT_DRAW; -File = "sc10700.bmp";Identifier = SID_TOOL_SELECT;File = "sco200.bmp -File = "sc10701.bmp";Identifier = SID_TOOL_ZOOM;File = "sco201.bmp -File = "sc10702.bmp";Identifier = SID_ZOOM_PLUS;File = "sco202.bmp -File = "sc10703.bmp";Identifier = SID_ZOOM_MINUS;File = "sco203.bmp -File = "sc10704.bmp";Identifier = SID_ZOOM_100_PERCENT;File = "sco204.bmp -File = "sc10705.bmp";Identifier = SID_ZOOM_PAGE;File = "sco205.bmp -File = "sc10706.bmp";Identifier = SID_ZOOM_OBJECTS;File = "sco206.bmp -File = "sc10724.bmp";Identifier = SID_TOOL_TEXT;File = "sco224.bmp - -File = "sc20000.bmp";Identifier = SID_ATTR_CHAR_COLOR;File = "charcol.bmp"; -File = "sc20001.bmp";Identifier = SID_TOOL_CONNECTOR;File = "sco298.bmp"; - -// Controller -File = "sc20002.bmp";Identifier = SID_TEMPLATE_APPLY; -File = "sc20003.bmp";Identifier = SID_ATTR_LINE_STYLE; -File = "sc20004.bmp";Identifier = SID_ATTR_LINE_WIDTH; -File = "sc20005.bmp";Identifier = SID_ATTR_LINE_COLOR; -File = "sc20006.bmp";Identifier = SID_ATTR_FILL_STYLE; -File = "sc20007.bmp";Identifier = SID_DIA_EFFECT; -File = "sc20008.bmp";Identifier = SID_DIA_SPEED; -File = "sc20009.bmp";Identifier = SID_DIA_AUTO; -File = "sc20010.bmp";Identifier = SID_DIA_TIME; -File = "sc20011.bmp";Identifier = SID_ATTR_FONT; -File = "sc20012.bmp";Identifier = SID_ATTR_FONTHEIGHT; - -// Bezier-Toolbar -File = "sc20013.bmp";Identifier = SID_BEZIER_EDGE; -File = "sc20014.bmp";Identifier = SID_BEZIER_SMOOTH; -File = "sc20015.bmp";Identifier = SID_BEZIER_SYMMTR; -File = "sc20016.bmp";Identifier = SID_BEZIER_CONVERT; - -// Standardleiste -File = "sc20020.bmp";Identifier = SID_INSERTPAGE; -File = "sc20094.bmp";Identifier = SID_MODIFYPAGE; -File = "sc20170.bmp";Identifier = SID_PRESENTATION_LAYOUT; - -// Basic-IDE ... diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 7a0d8e2f5..6f23c5653 100755 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -317,7 +317,7 @@ void LayerTabBar::EndRenaming() DBG_ASSERT( pDrView, "Rename layer undo action is only working with a SdDrawView" ); if( pDrView ) { - SfxUndoManager* pManager = pDoc->GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pManager = pDoc->GetDocSh()->GetUndoManager(); SdLayerModifyUndoAction* pAction = new SdLayerModifyUndoAction( pDoc, pLayer, diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 1f0f6402b..8ff8588b7 100755 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -1556,7 +1556,7 @@ void AssistentDlgImpl::UpdatePreview( BOOL bDocPreview ) { SfxObjectShell* pShell = xDocShell; DrawDocShell* pDocShell = PTR_CAST(DrawDocShell,pShell); - SfxUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL; + ::svl::IUndoManager* pUndoMgr = pDocShell?pDocShell->GetUndoManager():NULL; if(pUndoMgr) pUndoMgr->Undo(); mbUserDataDirty = TRUE; diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 135b453dc..b50e1b23f 100755 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -462,7 +462,7 @@ void DrawDocShell::Deactivate( BOOL ) |* \************************************************************************/ -SfxUndoManager* DrawDocShell::GetUndoManager() +::svl::IUndoManager* DrawDocShell::GetUndoManager() { return mpUndoManager; } @@ -600,7 +600,7 @@ void DrawDocShell::ClearUndoBuffer() pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, this, false); } - SfxUndoManager* pUndoManager = GetUndoManager(); + ::svl::IUndoManager* pUndoManager = GetUndoManager(); if(pUndoManager && pUndoManager->GetUndoActionCount()) pUndoManager->Clear(); } diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 9b9ed46f3..d9202e93c 100644..100755 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -146,7 +146,7 @@ void FuBullet::InsertFormattingMark( sal_Unicode cMark ) pOV->InsertText( aEmptyStr ); // prepare undo - SfxUndoManager& rUndoMgr = pOL->GetUndoManager(); + ::svl::IUndoManager& rUndoMgr = pOL->GetUndoManager(); rUndoMgr.EnterListAction(String(SdResId(STR_UNDO_INSERT_SPECCHAR)), aEmptyStr ); @@ -276,7 +276,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq ) SfxItemSet aOldSet( mpDoc->GetPool(), EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, 0 ); aOldSet.Put( pOV->GetAttribs() ); - SfxUndoManager& rUndoMgr = pOL->GetUndoManager(); + ::svl::IUndoManager& rUndoMgr = pOL->GetUndoManager(); rUndoMgr.EnterListAction(String(SdResId(STR_UNDO_INSERT_SPECCHAR)), aEmptyStr ); pOV->InsertText(aChars, TRUE); diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx index 21bd35039..2dfb0c664 100644..100755 --- a/sd/source/ui/func/fuoaprms.cxx +++ b/sd/source/ui/func/fuoaprms.cxx @@ -94,7 +94,7 @@ FunctionReference FuObjectAnimationParameters::Create( ViewShell* pViewSh, ::sd: void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq ) { - SfxUndoManager* pUndoMgr = mpViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager(); + ::svl::IUndoManager* pUndoMgr = mpViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager(); const SdrMarkList& rMarkList = mpView->GetMarkedObjectList(); ULONG nCount = rMarkList.GetMarkCount(); diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index c0f91586a..79b0318e1 100755 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -414,7 +414,7 @@ const SfxItemSet* FuPage::ExecuteDialog( Window* pParent ) else if( bSetToAllPages ) { String aComment(SdResId(STR_UNDO_CHANGE_PAGEFORMAT)); - SfxUndoManager* pUndoMgr = mpDocSh->GetUndoManager(); + ::svl::IUndoManager* pUndoMgr = mpDocSh->GetUndoManager(); pUndoMgr->EnterListAction(aComment, aComment); SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc); pUndoGroup->SetComment(aComment); diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx index 2709340ff..4022f1789 100755 --- a/sd/source/ui/inc/DrawDocShell.hxx +++ b/sd/source/ui/inc/DrawDocShell.hxx @@ -49,6 +49,7 @@ class SfxPrinter; struct SdrDocumentStreamInfo; struct SpellCallbackInfo; class AbstractSvxNameDialog; +class SfxUndoManager; namespace sd { @@ -100,7 +101,8 @@ public: virtual Rectangle GetVisArea(USHORT nAspect) const; virtual void Draw(OutputDevice*, const JobSetup& rSetup, USHORT nAspect = ASPECT_CONTENT); - virtual SfxUndoManager* GetUndoManager(); + virtual ::svl::IUndoManager* + GetUndoManager(); virtual Printer* GetDocumentPrinter(); virtual void OnDocumentPrinterChanged(Printer* pNewPrinter); virtual SfxStyleSheetBasePool* GetStyleSheetPool(); @@ -209,7 +211,7 @@ public: protected: SdDrawDocument* mpDoc; - SfxUndoManager* mpUndoManager; + SfxUndoManager* mpUndoManager; SfxPrinter* mpPrinter; ::sd::ViewShell* mpViewShell; FontList* mpFontList; diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx index 7f3e61bcb..50256444f 100755 --- a/sd/source/ui/inc/SlideSorterViewShell.hxx +++ b/sd/source/ui/inc/SlideSorterViewShell.hxx @@ -192,7 +192,7 @@ protected: /** This method is overloaded to handle a missing tool bar correctly. This is the case when the slide sorter is not the main view shell. */ - virtual SfxUndoManager* ImpGetUndoManager (void) const; + virtual ::svl::IUndoManager* ImpGetUndoManager (void) const; private: ::boost::shared_ptr<SlideSorter> mpSlideSorter; diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index ca181bde0..eacfb896f 100755 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -534,7 +534,7 @@ protected: ::std::auto_ptr<Implementation> mpImpl; // #96090# Support methods for centralized UNDO/REDO - virtual SfxUndoManager* ImpGetUndoManager (void) const; + virtual ::svl::IUndoManager* ImpGetUndoManager (void) const; void ImpGetUndoStrings(SfxItemSet &rSet) const; void ImpGetRedoStrings(SfxItemSet &rSet) const; void ImpSidUndo(BOOL bDrawViewShell, SfxRequest& rReq); diff --git a/sd/source/ui/inc/unmodpg.hxx b/sd/source/ui/inc/unmodpg.hxx index f4808d7b8..0ebd77516 100644..100755 --- a/sd/source/ui/inc/unmodpg.hxx +++ b/sd/source/ui/inc/unmodpg.hxx @@ -36,9 +36,6 @@ class SdPage; class ModifyPageUndoAction : public SdUndoAction { - // #67720# - SfxUndoManager* mpManager; - SdPage* mpPage; String maOldName; String maNewName; @@ -54,7 +51,6 @@ class ModifyPageUndoAction : public SdUndoAction public: TYPEINFO(); ModifyPageUndoAction( - SfxUndoManager* pManager, // #67720# SdDrawDocument* pTheDoc, SdPage* pThePage, String aTheNewName, diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 73a225501..7499a9801 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -969,7 +969,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( USHORT nPageId, const String & r SdPage* pPageToRename = NULL; PageKind ePageKind = mrSlideSorter.GetModel().GetPageType(); - SfxUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pManager = pDocument->GetDocSh()->GetUndoManager(); if( mrSlideSorter.GetModel().GetEditMode() == EM_PAGE ) { @@ -989,7 +989,7 @@ bool SlotManager::RenameSlideFromDrawViewShell( USHORT nPageId, const String & r // (#67720#) ModifyPageUndoAction* pAction = new ModifyPageUndoAction( - pManager, pDocument, pUndoPage, rName, pUndoPage->GetAutoLayout(), + pDocument, pUndoPage, rName, pUndoPage->GetAutoLayout(), aVisibleLayers.IsSet( nBackground ), aVisibleLayers.IsSet( nBgObj )); pManager->AddUndoAction( pAction ); diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 5246c2769..177d722a9 100755 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -321,7 +321,7 @@ bool SlideSorterViewShell::RelocateToParentWindow (::Window* pParentWindow) -SfxUndoManager* SlideSorterViewShell::ImpGetUndoManager (void) const +::svl::IUndoManager* SlideSorterViewShell::ImpGetUndoManager (void) const { SfxShell* pObjectBar = GetViewShellBase().GetViewShellManager()->GetTopShell(); if (pObjectBar != NULL) diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx index 2c29399a3..6c34c37e7 100755 --- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx +++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx @@ -290,7 +290,7 @@ void DocumentHelper::ProvideStyles ( // Add an undo action for the copied style sheets. if( !aCreatedStyles.empty() ) { - SfxUndoManager* pUndoManager = rTargetDocument.GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pUndoManager = rTargetDocument.GetDocSh()->GetUndoManager(); if (pUndoManager != NULL) { SdMoveStyleSheetsUndoAction* pMovStyles = @@ -341,7 +341,7 @@ void DocumentHelper::AssignMasterPageToPageList ( if (aCleanedList.size() == 0) break; - SfxUndoManager* pUndoMgr = rTargetDocument.GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pUndoMgr = rTargetDocument.GetDocSh()->GetUndoManager(); if( pUndoMgr ) pUndoMgr->EnterListAction(String(SdResId(STR_UNDO_SET_PRESLAYOUT)), String()); diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx index 6eb129da2..20f8c8be5 100755 --- a/sd/source/ui/view/ViewShellImplementation.cxx +++ b/sd/source/ui/view/ViewShellImplementation.cxx @@ -212,7 +212,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( SdPage* pUndoPage = bHandoutMode ? pHandoutMPage : pCurrentPage; - SfxUndoManager* pUndoManager = mrViewShell.GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pUndoManager = mrViewShell.GetDocSh()->GetUndoManager(); DBG_ASSERT(pUndoManager, "No UNDO MANAGER ?!?"); if( pUndoManager ) @@ -220,7 +220,7 @@ void ViewShell::Implementation::ProcessModifyPageSlot ( String aComment( SdResId(STR_UNDO_MODIFY_PAGE) ); pUndoManager->EnterListAction(aComment, aComment); ModifyPageUndoAction* pAction = new ModifyPageUndoAction( - pUndoManager, pDocument, pUndoPage, aNewName, aNewAutoLayout, bBVisible, bBObjsVisible); + pDocument, pUndoPage, aNewName, aNewAutoLayout, bBVisible, bBObjsVisible); pUndoManager->AddUndoAction(pAction); // Clear the selection because the selectec object may be removed as diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 15b48372d..52640989c 100755 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -915,7 +915,7 @@ void ViewShellManager::Implementation::UpdateShellStack (void) // Remember the undo manager from the top-most shell on the stack. SfxShell* pTopMostShell = mrBase.GetSubShell(0); - SfxUndoManager* pUndoManager = (pTopMostShell!=NULL) + ::svl::IUndoManager* pUndoManager = (pTopMostShell!=NULL) ? pTopMostShell->GetUndoManager() : NULL; @@ -1015,7 +1015,7 @@ void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShe // Remember the undo manager from the top-most shell on the stack. SfxShell* pTopMostShell = mrBase.GetSubShell(0); - SfxUndoManager* pUndoManager = (pTopMostShell!=NULL) + ::svl::IUndoManager* pUndoManager = (pTopMostShell!=NULL) ? pTopMostShell->GetUndoManager() : NULL; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index d8c363c09..21787ee6b 100755 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -151,7 +151,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) if( rReq.GetArgs() ) { BOOL bMergeUndo = FALSE; - SfxUndoManager* pUndoManager = GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pUndoManager = GetDocSh()->GetUndoManager(); // Anpassungen Start/EndWidth #63083# if(nSId == SID_ATTR_LINE_WIDTH) diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index 9febd1675..3647eb01a 100755 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -356,7 +356,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq) break; } - SfxUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager(); SdLayerModifyUndoAction* pAction = new SdLayerModifyUndoAction( GetDoc(), pLayer, @@ -748,9 +748,9 @@ bool DrawViewShell::RenameSlide( USHORT nPageId, const String & rName ) SetOfByte aVisibleLayers = mpActualPage->TRG_GetMasterPageVisibleLayers(); // (#67720#) - SfxUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager(); + ::svl::IUndoManager* pManager = GetDoc()->GetDocSh()->GetUndoManager(); ModifyPageUndoAction* pAction = new ModifyPageUndoAction( - pManager, GetDoc(), pUndoPage, rName, pUndoPage->GetAutoLayout(), + GetDoc(), pUndoPage, rName, pUndoPage->GetAutoLayout(), aVisibleLayers.IsSet( nBackground ), aVisibleLayers.IsSet( nBgObj )); pManager->AddUndoAction( pAction ); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 0dcada925..8e483c59f 100755 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1451,7 +1451,7 @@ SdPage* OutlineView::GetActualPage() SdPage* pCurrent = GetPageForParagraph(static_cast<Paragraph*>(pSelList->First()) ); DBG_ASSERT( pCurrent || - (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->isInUndo()) || + (mpDocSh->GetUndoManager() && static_cast< sd::UndoManager *>(mpDocSh->GetUndoManager())->IsDoing()) || maDragAndDropModelGuard.get(), "sd::OutlineView::GetActualPage(), no current page?" ); if( pCurrent ) @@ -1783,7 +1783,7 @@ void OutlineView::EndModelChange() { UpdateDocument(); - SfxUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); + ::svl::IUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); bool bHasUndoActions = pDocUndoMgr->GetUndoActionCount() != 0; @@ -1801,6 +1801,9 @@ void OutlineView::EndModelChange() if( bHasUndoActions && mpOutliner->GetEditEngine().HasTriedMergeOnLastAddUndo() ) TryToMergeUndoActions(); + + mpOutlineViewShell->Invalidate( SID_UNDO ); + mpOutlineViewShell->Invalidate( SID_REDO ); } /** updates all changes in the outliner model to the draw model */ @@ -1838,7 +1841,7 @@ void OutlineView::UpdateDocument() /** merge edit engine undo actions if possible */ void OutlineView::TryToMergeUndoActions() { - SfxUndoManager& rOutlineUndo = mpOutliner->GetUndoManager(); + ::svl::IUndoManager& rOutlineUndo = mpOutliner->GetUndoManager(); if( rOutlineUndo.GetUndoActionCount() > 1 ) { SfxListUndoAction* pListAction = dynamic_cast< SfxListUndoAction* >( rOutlineUndo.GetUndoAction(0) ); @@ -1846,11 +1849,11 @@ void OutlineView::TryToMergeUndoActions() if( pListAction && pPrevListAction ) { // find the top EditUndo action in the top undo action list - USHORT nAction = pListAction->aUndoActions.Count(); + size_t nAction = pListAction->aUndoActions.size(); EditUndo* pEditUndo = 0; while( !pEditUndo && nAction ) { - pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction]); + pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction].pAction); } USHORT nEditPos = nAction; // we need this later to remove the merged undo actions @@ -1858,7 +1861,7 @@ void OutlineView::TryToMergeUndoActions() // make sure it is the only EditUndo action in the top undo list while( pEditUndo && nAction ) { - if( dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction]) ) + if( dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction].pAction) ) pEditUndo = 0; } @@ -1867,10 +1870,10 @@ void OutlineView::TryToMergeUndoActions() { // yes, see if we can merge it with the prev undo list - nAction = pPrevListAction->aUndoActions.Count(); + nAction = pPrevListAction->aUndoActions.size(); EditUndo* pPrevEditUndo = 0; while( !pPrevEditUndo && nAction ) - pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->aUndoActions[--nAction]); + pPrevEditUndo = dynamic_cast< EditUndo* >(pPrevListAction->aUndoActions[--nAction].pAction); if( pPrevEditUndo && pPrevEditUndo->Merge( pEditUndo ) ) { @@ -1878,22 +1881,23 @@ void OutlineView::TryToMergeUndoActions() // the top EditUndo of the previous undo list // first remove the merged undo action - DBG_ASSERT( pListAction->aUndoActions[nEditPos] == pEditUndo, "sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" ); + DBG_ASSERT( pListAction->aUndoActions[nEditPos].pAction == pEditUndo, + "sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" ); pListAction->aUndoActions.Remove(nEditPos); delete pEditUndo; // now check if we also can merge the draw undo actions - SfxUndoManager* pDocUndoManager = mpDocSh->GetUndoManager(); - if( pDocUndoManager && ( pListAction->aUndoActions.Count() == 1 )) + ::svl::IUndoManager* pDocUndoManager = mpDocSh->GetUndoManager(); + if( pDocUndoManager && ( pListAction->aUndoActions.size() == 1 )) { - SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions[0] ); + SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions[0].pAction ); SfxLinkUndoAction* pPrevLinkAction = 0; if( pLinkAction ) { - nAction = pPrevListAction->aUndoActions.Count(); + nAction = pPrevListAction->aUndoActions.size(); while( !pPrevLinkAction && nAction ) - pPrevLinkAction = dynamic_cast< SfxLinkUndoAction* >(pPrevListAction->aUndoActions[--nAction]); + pPrevLinkAction = dynamic_cast< SfxLinkUndoAction* >(pPrevListAction->aUndoActions[--nAction].pAction); } if( pLinkAction && pPrevLinkAction && @@ -1905,15 +1909,15 @@ void OutlineView::TryToMergeUndoActions() if( pSourceList && pDestinationList ) { - USHORT nCount = pSourceList->aUndoActions.Count(); - USHORT nDestAction = pDestinationList->aUndoActions.Count(); + USHORT nCount = pSourceList->aUndoActions.size(); + USHORT nDestAction = pDestinationList->aUndoActions.size(); while( nCount-- ) { - const SfxUndoAction* pTemp = pSourceList->aUndoActions.GetObject(0); + SfxUndoAction* pTemp = pSourceList->aUndoActions[0].pAction; pSourceList->aUndoActions.Remove(0); pDestinationList->aUndoActions.Insert( pTemp, nDestAction++ ); } - pDestinationList->nCurUndoAction = pDestinationList->aUndoActions.Count(); + pDestinationList->nCurUndoAction = pDestinationList->aUndoActions.size(); pListAction->aUndoActions.Remove(0); delete pLinkAction; @@ -1923,21 +1927,21 @@ void OutlineView::TryToMergeUndoActions() } } - if( pListAction->aUndoActions.Count() ) + if ( !pListAction->aUndoActions.empty() ) { // now we have to move all remaining doc undo actions from the top undo // list to the previous undo list and remove the top undo list - USHORT nCount = pListAction->aUndoActions.Count(); - USHORT nDestAction = pPrevListAction->aUndoActions.Count(); + size_t nCount = pListAction->aUndoActions.size(); + size_t nDestAction = pPrevListAction->aUndoActions.size(); while( nCount-- ) { - const SfxUndoAction* pTemp = pListAction->aUndoActions.GetObject(0); + SfxUndoAction* pTemp = pListAction->aUndoActions[0].pAction; pListAction->aUndoActions.Remove(0); if( pTemp ) pPrevListAction->aUndoActions.Insert( pTemp, nDestAction++ ); } - pPrevListAction->nCurUndoAction = pPrevListAction->aUndoActions.Count(); + pPrevListAction->nCurUndoAction = pPrevListAction->aUndoActions.size(); } rOutlineUndo.RemoveLastUndoAction(); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index e10246772..c24fb1932 100755 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1167,7 +1167,7 @@ bool View::isRecordingUndo() const if( mpDoc && mpDoc->IsUndoEnabled() ) { sd::UndoManager* pUndoManager = mpDoc ? mpDoc->GetUndoManager() : 0; - return pUndoManager && pUndoManager->isInListAction(); + return pUndoManager && pUndoManager->IsInListAction(); } else { diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx index 5c0ecde02..514a2f935 100644..100755 --- a/sd/source/ui/view/unmodpg.cxx +++ b/sd/source/ui/view/unmodpg.cxx @@ -56,15 +56,13 @@ TYPEINIT1(ModifyPageUndoAction, SdUndoAction); \************************************************************************/ ModifyPageUndoAction::ModifyPageUndoAction( - SfxUndoManager* pTheManager, // #67720# SdDrawDocument* pTheDoc, SdPage* pThePage, String aTheNewName, AutoLayout eTheNewAutoLayout, BOOL bTheNewBckgrndVisible, BOOL bTheNewBckgrndObjsVisible) -: SdUndoAction(pTheDoc), - mpManager(pTheManager) +: SdUndoAction(pTheDoc) { DBG_ASSERT(pThePage, "Undo ohne Seite ???"); diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index a4a596814..049319e37 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -151,7 +151,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) // #96090# if(SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_UNDO)) { - SfxUndoManager* pUndoManager = ImpGetUndoManager(); + ::svl::IUndoManager* pUndoManager = ImpGetUndoManager(); sal_Bool bActivate(FALSE); if(pUndoManager) @@ -179,7 +179,7 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) // #96090# if(SFX_ITEM_AVAILABLE == rSet.GetItemState(SID_REDO)) { - SfxUndoManager* pUndoManager = ImpGetUndoManager(); + ::svl::IUndoManager* pUndoManager = ImpGetUndoManager(); sal_Bool bActivate(FALSE); if(pUndoManager) diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 927c308ab..6a194c5f5 100755 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -85,6 +85,7 @@ #include <svx/extrusionbar.hxx> #include <svx/fontworkbar.hxx> #include <svx/svdoutl.hxx> +#include <tools/diagnose_ex.h> // #96090# #include <svl/slstitm.hxx> @@ -1040,7 +1041,7 @@ void ViewShell::UpdatePreview (SdPage*, BOOL ) // usefull is still done. } -SfxUndoManager* ViewShell::ImpGetUndoManager (void) const +::svl::IUndoManager* ViewShell::ImpGetUndoManager (void) const { const ViewShell* pMainViewShell = GetViewShellBase().GetMainViewShell().get(); @@ -1081,7 +1082,7 @@ SfxUndoManager* ViewShell::ImpGetUndoManager (void) const void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const { - SfxUndoManager* pUndoManager = ImpGetUndoManager(); + ::svl::IUndoManager* pUndoManager = ImpGetUndoManager(); if(pUndoManager) { sal_uInt16 nCount(pUndoManager->GetUndoActionCount()); @@ -1116,7 +1117,7 @@ void ViewShell::ImpGetUndoStrings(SfxItemSet &rSet) const void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const { - SfxUndoManager* pUndoManager = ImpGetUndoManager(); + ::svl::IUndoManager* pUndoManager = ImpGetUndoManager(); if(pUndoManager) { sal_uInt16 nCount(pUndoManager->GetRedoActionCount()); @@ -1151,7 +1152,7 @@ void ViewShell::ImpGetRedoStrings(SfxItemSet &rSet) const void ViewShell::ImpSidUndo(BOOL, SfxRequest& rReq) { - SfxUndoManager* pUndoManager = ImpGetUndoManager(); + ::svl::IUndoManager* pUndoManager = ImpGetUndoManager(); sal_uInt16 nNumber(1); const SfxItemSet* pReqArgs = rReq.GetArgs(); @@ -1166,11 +1167,19 @@ void ViewShell::ImpSidUndo(BOOL, SfxRequest& rReq) sal_uInt16 nCount(pUndoManager->GetUndoActionCount()); if(nCount >= nNumber) { - // #94637# when UndoStack is cleared by ModifyPageUndoAction - // the nCount may have changed, so test GetUndoActionCount() - while(nNumber-- && pUndoManager->GetUndoActionCount()) + try { - pUndoManager->Undo(); + // #94637# when UndoStack is cleared by ModifyPageUndoAction + // the nCount may have changed, so test GetUndoActionCount() + while(nNumber-- && pUndoManager->GetUndoActionCount()) + { + pUndoManager->Undo(); + } + } + catch( const Exception& e ) + { + // no need to handle. By definition, the UndoManager handled this by clearing the + // Undo/Redo stacks } } @@ -1192,7 +1201,7 @@ void ViewShell::ImpSidUndo(BOOL, SfxRequest& rReq) void ViewShell::ImpSidRedo(BOOL, SfxRequest& rReq) { - SfxUndoManager* pUndoManager = ImpGetUndoManager(); + ::svl::IUndoManager* pUndoManager = ImpGetUndoManager(); sal_uInt16 nNumber(1); const SfxItemSet* pReqArgs = rReq.GetArgs(); @@ -1207,11 +1216,19 @@ void ViewShell::ImpSidRedo(BOOL, SfxRequest& rReq) sal_uInt16 nCount(pUndoManager->GetRedoActionCount()); if(nCount >= nNumber) { - // #94637# when UndoStack is cleared by ModifyPageRedoAction - // the nCount may have changed, so test GetRedoActionCount() - while(nNumber-- && pUndoManager->GetRedoActionCount()) + try + { + // #94637# when UndoStack is cleared by ModifyPageRedoAction + // the nCount may have changed, so test GetRedoActionCount() + while(nNumber-- && pUndoManager->GetRedoActionCount()) + { + pUndoManager->Redo(); + } + } + catch( const Exception& e ) { - pUndoManager->Redo(); + // no need to handle. By definition, the UndoManager handled this by clearing the + // Undo/Redo stacks } } |