From f98434f6479405caa9beebd8af4abe0d16fcd0d8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 14 Oct 2010 16:40:32 +0200 Subject: undoapi: first sketch of the listener API - not sure this will survive 'til the final version --- sd/inc/undo/undomanager.hxx | 4 ++-- sd/source/core/undo/undomanager.cxx | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 sd/inc/undo/undomanager.hxx mode change 100644 => 100755 sd/source/core/undo/undomanager.cxx (limited to 'sd') diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx old mode 100644 new mode 100755 index b2e40c1e7442..8aa5ddb97eae --- a/sd/inc/undo/undomanager.hxx +++ b/sd/inc/undo/undomanager.hxx @@ -47,8 +47,8 @@ public: bool isInListAction() const { return mnListLevel != 0; } bool isInUndo() const { return maIsInUndoLock.isLocked(); } - virtual BOOL Undo( USHORT nCount=1 ); - virtual BOOL Redo( USHORT nCount=1 ); + virtual BOOL Undo(); + virtual BOOL Redo(); /** Set or reset the undo manager linked with the called undo manager. */ diff --git a/sd/source/core/undo/undomanager.cxx b/sd/source/core/undo/undomanager.cxx old mode 100644 new mode 100755 index f3fe9b11c2bd..3278123f238c --- a/sd/source/core/undo/undomanager.cxx +++ b/sd/source/core/undo/undomanager.cxx @@ -79,16 +79,16 @@ void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALS } -BOOL UndoManager::Undo( USHORT nCount ) +BOOL UndoManager::Undo() { ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Undo( nCount ); + return SfxUndoManager::Undo(); } -BOOL UndoManager::Redo( USHORT nCount ) +BOOL UndoManager::Redo() { ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Redo( nCount ); + return SfxUndoManager::Redo(); } -- cgit From bb7333e024b5db1bb1338f5c65eefb29323366a7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 15 Oct 2010 11:59:05 +0200 Subject: undoapi: removed unused file --- sd/source/ui/app/app.img | 120 ----------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 sd/source/ui/app/app.img (limited to 'sd') diff --git a/sd/source/ui/app/app.img b/sd/source/ui/app/app.img deleted file mode 100644 index a435b84b8887..000000000000 --- 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 ... -- cgit From 6702f4e83f29060a3a6b832920ab6dbdc33b937a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 20 Oct 2010 14:54:59 +0200 Subject: undoapi: made SfxUndoManager an implementation of the new, abstract ::svl::IUndoManager interface. Change the SfxShell's UndoManager attribute to be an IUndoManager. Did all the resulting changes up the source tree. This way, we'll hopefully be able to provide an IUndoManager implementation in Writer, which is not based on the SfxUndoManager, but on Writer's own Undo implementation. --- sd/inc/undo/undomanager.hxx | 4 ++-- sd/source/core/drawdoc3.cxx | 6 +++--- sd/source/core/undo/undomanager.cxx | 2 +- sd/source/ui/animations/CustomAnimationPane.cxx | 4 ++-- sd/source/ui/animations/SlideTransitionPane.cxx | 6 +++--- sd/source/ui/dlg/LayerTabBar.cxx | 2 +- sd/source/ui/dlg/dlgass.cxx | 2 +- sd/source/ui/docshell/docshell.cxx | 4 ++-- sd/source/ui/func/fubullet.cxx | 4 ++-- sd/source/ui/func/fuoaprms.cxx | 2 +- sd/source/ui/func/fupage.cxx | 2 +- sd/source/ui/inc/DrawDocShell.hxx | 3 ++- sd/source/ui/inc/SlideSorterViewShell.hxx | 2 +- sd/source/ui/inc/ViewShell.hxx | 2 +- sd/source/ui/inc/unmodpg.hxx | 4 ---- sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 4 ++-- sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 2 +- sd/source/ui/toolpanel/controls/DocumentHelper.cxx | 4 ++-- sd/source/ui/view/ViewShellImplementation.cxx | 4 ++-- sd/source/ui/view/ViewShellManager.cxx | 4 ++-- sd/source/ui/view/drviews2.cxx | 2 +- sd/source/ui/view/drviewsb.cxx | 6 +++--- sd/source/ui/view/outlview.cxx | 6 +++--- sd/source/ui/view/unmodpg.cxx | 4 +--- sd/source/ui/view/viewshe3.cxx | 4 ++-- sd/source/ui/view/viewshel.cxx | 10 +++++----- 26 files changed, 47 insertions(+), 52 deletions(-) mode change 100644 => 100755 sd/source/ui/animations/CustomAnimationPane.cxx mode change 100644 => 100755 sd/source/ui/dlg/LayerTabBar.cxx mode change 100644 => 100755 sd/source/ui/func/fubullet.cxx mode change 100644 => 100755 sd/source/ui/func/fuoaprms.cxx mode change 100644 => 100755 sd/source/ui/inc/unmodpg.hxx mode change 100644 => 100755 sd/source/ui/view/drviewsb.cxx mode change 100644 => 100755 sd/source/ui/view/unmodpg.cxx (limited to 'sd') diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx index 8aa5ddb97eae..c1cb440f9a70 100755 --- a/sd/inc/undo/undomanager.hxx +++ b/sd/inc/undo/undomanager.hxx @@ -52,7 +52,7 @@ public: /** Set or reset the undo manager linked with the called undo manager. */ - void SetLinkedUndoManager (SfxUndoManager* pLinkedUndoManager); + void SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager); private: using SfxUndoManager::Undo; @@ -64,7 +64,7 @@ private: /** Used when the outline view is visible as a last resort to synchronize the undo managers. */ - SfxUndoManager* mpLinkedUndoManager; + ::svl::IUndoManager* mpLinkedUndoManager; /** Call ClearRedo() at the linked undo manager, when present. diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 025700a790fc..43e44ce1e70f 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/undo/undomanager.cxx b/sd/source/core/undo/undomanager.cxx index 3278123f238c..a076ec8b4a08 100755 --- a/sd/source/core/undo/undomanager.cxx +++ b/sd/source/core/undo/undomanager.cxx @@ -94,7 +94,7 @@ BOOL UndoManager::Redo() -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 old mode 100644 new mode 100755 index 8b96e08b4a8c..7543d9a0f919 --- 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 ); @@ -2451,7 +2451,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 fe34f0138db2..88b30ab658e3 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/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx old mode 100644 new mode 100755 index 29425a3bda71..cd5977772bfe --- 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 1eb3a3d0cedc..1ea519d02561 100755 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -1554,7 +1554,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 78b1b9434ad0..9714d8599374 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 old mode 100644 new mode 100755 index 92b1450624e1..92aa2d3cc9f3 --- 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 old mode 100644 new mode 100755 index b348d6533930..980176b20b19 --- 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 3dea67412fac..b41134b73f02 100755 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -409,7 +409,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 4ad4b0d09392..34610cd82c1c 100755 --- a/sd/source/ui/inc/DrawDocShell.hxx +++ b/sd/source/ui/inc/DrawDocShell.hxx @@ -100,7 +100,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(); diff --git a/sd/source/ui/inc/SlideSorterViewShell.hxx b/sd/source/ui/inc/SlideSorterViewShell.hxx index 2b03cd636d0f..de1e1ebae006 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 mpSlideSorter; diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index e6e6b401cb57..195e323f579d 100755 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -534,7 +534,7 @@ protected: ::std::auto_ptr 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 old mode 100644 new mode 100755 index 185dc90b24bf..9a811b445f42 --- 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 ded7c2ebfdde..6b1782906471 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -948,7 +948,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 ) { @@ -968,7 +968,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 f8e7e13cdd2b..b1bcc7050a77 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 c5919b7aa7ee..f7d470e56333 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 fdd7c530137f..2a574fa087ef 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 c25c0f11270a..c0480aed6e70 100755 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -913,7 +913,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; @@ -1013,7 +1013,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 7aaba7d9c4fa..092dce05a196 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 old mode 100644 new mode 100755 index 2574032e3d99..14b3a71126fb --- 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 dfad4b34c6f2..2f2da8c05bb6 100755 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1783,7 +1783,7 @@ void OutlineView::EndModelChange() { UpdateDocument(); - SfxUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); + ::svl::IUndoManager* pDocUndoMgr = mpDocSh->GetUndoManager(); bool bHasUndoActions = pDocUndoMgr->GetUndoActionCount() != 0; @@ -1838,7 +1838,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) ); @@ -1883,7 +1883,7 @@ void OutlineView::TryToMergeUndoActions() delete pEditUndo; // now check if we also can merge the draw undo actions - SfxUndoManager* pDocUndoManager = mpDocSh->GetUndoManager(); + ::svl::IUndoManager* pDocUndoManager = mpDocSh->GetUndoManager(); if( pDocUndoManager && ( pListAction->aUndoActions.Count() == 1 )) { SfxLinkUndoAction* pLinkAction = dynamic_cast< SfxLinkUndoAction* >( pListAction->aUndoActions[0] ); diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx old mode 100644 new mode 100755 index 5a7f9830895e..66e5c7a506e5 --- 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 7ce0b577ed9e..729ba1575696 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -150,7 +150,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) @@ -178,7 +178,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 7885d07e5f2c..224301ce9fec 100755 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -1040,7 +1040,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 +1081,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 +1116,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 +1151,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(); @@ -1192,7 +1192,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(); -- cgit From e69cf54b8aa7f6b38c489b1d679cd6753a558997 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 21 Oct 2010 12:12:16 +0200 Subject: undoapi: specified (and implemented and tested) what should happen when you leave an Undo context which does not have any elements --- sd/inc/undo/undomanager.hxx | 2 +- sd/source/core/undo/undomanager.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'sd') diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx index c1cb440f9a70..a02dd57886d1 100755 --- a/sd/inc/undo/undomanager.hxx +++ b/sd/inc/undo/undomanager.hxx @@ -40,7 +40,7 @@ public: UndoManager( USHORT nMaxUndoActionCount = 20 ); virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0); - virtual void LeaveListAction(); + virtual USHORT LeaveListAction(); virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE ); diff --git a/sd/source/core/undo/undomanager.cxx b/sd/source/core/undo/undomanager.cxx index a076ec8b4a08..4ebefe9fd469 100755 --- a/sd/source/core/undo/undomanager.cxx +++ b/sd/source/core/undo/undomanager.cxx @@ -49,11 +49,12 @@ void UndoManager::EnterListAction(const UniString &rComment, const UniString& rR } } -void UndoManager::LeaveListAction() +USHORT UndoManager::LeaveListAction() { + USHORT nListElements = 0; if( !isInUndo() ) { - SfxUndoManager::LeaveListAction(); + nListElements = SfxUndoManager::LeaveListAction(); if( mnListLevel ) { mnListLevel--; @@ -63,6 +64,7 @@ void UndoManager::LeaveListAction() DBG_ERROR("sd::UndoManager::LeaveListAction(), no open list action!" ); } } + return nListElements; } void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALSE */ ) -- cgit From 8b7bfef9fba15a3d47e3bc460a33c13ea3faf5fa Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 22 Oct 2010 15:00:39 +0200 Subject: undoapi: more I/SfxUndoManager changes in preparation of new Undo API features --- sd/inc/undo/undomanager.hxx | 10 ---------- sd/source/core/sdpage.cxx | 14 ++++++------- sd/source/core/undo/undomanager.cxx | 39 ++----------------------------------- sd/source/ui/inc/DrawDocShell.hxx | 1 + sd/source/ui/view/outlview.cxx | 2 +- sd/source/ui/view/sdview.cxx | 2 +- 6 files changed, 12 insertions(+), 56 deletions(-) (limited to 'sd') diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx index a02dd57886d1..708a05390f12 100755 --- a/sd/inc/undo/undomanager.hxx +++ b/sd/inc/undo/undomanager.hxx @@ -40,16 +40,9 @@ public: UndoManager( USHORT nMaxUndoActionCount = 20 ); virtual void EnterListAction(const UniString &rComment, const UniString& rRepeatComment, USHORT nId=0); - virtual USHORT LeaveListAction(); virtual void AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg=FALSE ); - bool isInListAction() const { return mnListLevel != 0; } - bool isInUndo() const { return maIsInUndoLock.isLocked(); } - - virtual BOOL Undo(); - virtual BOOL Redo(); - /** Set or reset the undo manager linked with the called undo manager. */ void SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager); @@ -58,9 +51,6 @@ private: using SfxUndoManager::Undo; using SfxUndoManager::Redo; - int mnListLevel; - ScopeLock maIsInUndoLock; - /** Used when the outline view is visible as a last resort to synchronize the undo managers. */ diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 971bb2340069..c5ca4532cfc9 100755 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -252,7 +252,7 @@ void SdPage::EnsureMasterPageDefaultBackground() SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rectangle& rRect, BOOL /* bInsert */ ) { sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); SdrObject* pSdrObj = NULL; @@ -717,9 +717,9 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang if( pObj->GetUserCall() ) { sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + 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 ) @@ -768,7 +768,7 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang void SdPage::CreateTitleAndLayout(BOOL bInit, BOOL bCreate ) { sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); SdPage* pMasterPage = this; @@ -1555,7 +1555,7 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, BOOL bInit, BOOL bCreate ) const bool bSwitchLayout = eLayout != GetAutoLayout(); sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); meAutoLayout = eLayout; @@ -2113,7 +2113,7 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, return pSourceObj; sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && rPage.IsInserted(); + const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && rPage.IsInserted(); SdrObject* pNewObj = pSourceObj; if((eObjKind == PRESOBJ_OUTLINE) && (pSourceObj->GetObjIdentifier() == OBJ_TEXT) ) @@ -2253,7 +2253,7 @@ 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(pModel)->GetUndoManager() : 0; - const bool bUndo = pUndoManager && pUndoManager->isInListAction() && IsInserted(); + 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 4ebefe9fd469..6ee11d03e392 100755 --- a/sd/source/core/undo/undomanager.cxx +++ b/sd/source/core/undo/undomanager.cxx @@ -34,42 +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 ); } } -USHORT UndoManager::LeaveListAction() -{ - USHORT nListElements = 0; - if( !isInUndo() ) - { - nListElements = SfxUndoManager::LeaveListAction(); - if( mnListLevel ) - { - mnListLevel--; - } - else - { - DBG_ERROR("sd::UndoManager::LeaveListAction(), no open list action!" ); - } - } - return nListElements; -} - void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALSE */ ) { - if( !isInUndo() ) + if( !IsDoing() ) { ClearLinkedRedoActions(); SfxUndoManager::AddUndoAction( pAction, bTryMerg ); @@ -81,21 +61,6 @@ void UndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerg /* = FALS } -BOOL UndoManager::Undo() -{ - ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Undo(); -} - -BOOL UndoManager::Redo() -{ - ScopeLockGuard aGuard( maIsInUndoLock ); - return SfxUndoManager::Redo(); -} - - - - void UndoManager::SetLinkedUndoManager (::svl::IUndoManager* pLinkedUndoManager) { mpLinkedUndoManager = pLinkedUndoManager; diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx index 34610cd82c1c..b3f626f62137 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 { diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 2f2da8c05bb6..1aa0594194fa 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(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 ) diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 3aed9c6c0d9c..36d55213ab78 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 { -- cgit From 9ea34090bb77f5702da601a8ae374e5047898887 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 25 Oct 2010 11:48:17 +0200 Subject: undoapi: defined, implemented, and tested the exception handling for XUndoAction/Manager::Undo --- sd/source/ui/view/viewshel.cxx | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 224301ce9fec..89988f231ecd 100755 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -85,6 +85,7 @@ #include #include #include +#include // #96090# #include @@ -1166,11 +1167,18 @@ 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 ) + { + DBG_UNHANDLED_EXCEPTION(); } } @@ -1207,11 +1215,18 @@ 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(); + DBG_UNHANDLED_EXCEPTION(); } } -- cgit From 19b80994ffc3c5740b9b7ce0c2755bae9623501b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 27 Oct 2010 12:49:06 +0200 Subject: undoapi: +SfxViewShell::EnterStandardMode (so far, only dummy implementations in the apps except sw) --- sd/source/ui/inc/ViewShellBase.hxx | 1 + sd/source/ui/view/ViewShellBase.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) (limited to 'sd') diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index 38f7223f1d83..4ff64456ad2f 100755 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -188,6 +188,7 @@ public: virtual void WriteUserData (String&, BOOL bBrowse = FALSE); virtual void ReadUserData (const String&, BOOL bBrowse = FALSE); virtual SdrView* GetDrawView (void) const; + virtual void EnterStandardMode(); virtual void AdjustPosSizePixel (const Point &rOfs, const Size &rSize); /** When is given, then the mouse shape is set to hour glass (or diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index c748ffbc05e0..ff373da66579 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -1003,6 +1003,18 @@ SdrView* ViewShellBase::GetDrawView (void) const +void ViewShellBase::EnterStandardMode() +{ + SdrView* pView = GetDrawView(); + // finish text editing + if ( pView && pView->IsTextEdit() ) + pView->SdrEndTextEdit(); + // more? +} + + + + void ViewShellBase::AdjustPosSizePixel (const Point &rOfs, const Size &rSize) { SfxViewShell::AdjustPosSizePixel (rOfs, rSize); -- cgit From 4aa4dfd21315d5f0707ba60a322d2cde10e7f2a4 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 27 Oct 2010 12:49:10 +0200 Subject: undoapi: EndModelChange: Invalid SID_UNDO/REDO --- sd/source/ui/view/outlview.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sd') diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 1aa0594194fa..e012da280103 100755 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -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 */ -- cgit From 395483cdcb04630a52cba44291cb93b72323e97f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 27 Oct 2010 13:20:24 +0200 Subject: undoapi: no need to assert (via DBG_UNHANDLED_EXCEPTION) exceptions caught while calling IUndoManager::Undo/Redo: by defnition, the manager handled this by clearing the stacks --- sd/source/ui/view/viewshel.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 89988f231ecd..7f142ded077e 100755 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -1178,7 +1178,8 @@ void ViewShell::ImpSidUndo(BOOL, SfxRequest& rReq) } catch( const Exception& e ) { - DBG_UNHANDLED_EXCEPTION(); + // no need to handle. By definition, the UndoManager handled this by clearing the + // Undo/Redo stacks } } @@ -1226,7 +1227,8 @@ void ViewShell::ImpSidRedo(BOOL, SfxRequest& rReq) } catch( const Exception& e ) { - DBG_UNHANDLED_EXCEPTION(); + // no need to handle. By definition, the UndoManager handled this by clearing the + // Undo/Redo stacks } } -- cgit From 0e3c6f024b0b36c10b9a82dad79eb58baffb555b Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 4 Nov 2010 12:11:17 +0100 Subject: undoapi: no need to access an sd::UndoManager where an svl::IUndoManager is sufficient --- sd/source/core/sdpage.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sd') diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index b8b6f7c25acc..c52cd24270ee 100755 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -251,7 +251,7 @@ void SdPage::EnsureMasterPageDefaultBackground() */ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, BOOL bVertical, const Rectangle& rRect, BOOL /* bInsert */ ) { - sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; + ::svl::IUndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); SdrObject* pSdrObj = NULL; @@ -716,7 +716,7 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang { if( pObj->GetUserCall() ) { - sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; + ::svl::IUndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); /* DBG_ASSERT( bUndo || (pUndoManager && pUndoManager->IsDoing()), @@ -767,7 +767,7 @@ void SdPage::Changed(const SdrObject& rObj, SdrUserCallType eType, const Rectang void SdPage::CreateTitleAndLayout(BOOL bInit, BOOL bCreate ) { - sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; + ::svl::IUndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); SdPage* pMasterPage = this; @@ -1554,7 +1554,7 @@ void SdPage::SetAutoLayout(AutoLayout eLayout, BOOL bInit, BOOL bCreate ) const bool bSwitchLayout = eLayout != GetAutoLayout(); - sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; + ::svl::IUndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); meAutoLayout = eLayout; @@ -2112,7 +2112,7 @@ SdrObject* convertPresentationObjectImpl( SdPage& rPage, SdrObject* pSourceObj, if( !pModel || !pSourceObj ) return pSourceObj; - sd::UndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; + ::svl::IUndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && rPage.IsInserted(); SdrObject* pNewObj = pSourceObj; @@ -2252,7 +2252,7 @@ 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(pModel)->GetUndoManager() : 0; + ::svl::IUndoManager* pUndoManager = pModel ? static_cast(pModel)->GetUndoManager() : 0; const bool bUndo = pUndoManager && pUndoManager->IsInListAction() && IsInserted(); if (!pObj && bInit) -- cgit From 2b9a26dea1ac3f9b2f85d9c693e9b070fe5ac0d6 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 19 Nov 2010 10:36:41 +0100 Subject: undoapi: removed EnterStandardMode, again. The requirements / results in the different applications are that different - it does make sense to have a single method doing this, as defining its semantics is rather impossible --- sd/source/ui/inc/ViewShellBase.hxx | 1 - sd/source/ui/view/ViewShellBase.cxx | 12 ------------ 2 files changed, 13 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/inc/ViewShellBase.hxx b/sd/source/ui/inc/ViewShellBase.hxx index 4ff64456ad2f..38f7223f1d83 100755 --- a/sd/source/ui/inc/ViewShellBase.hxx +++ b/sd/source/ui/inc/ViewShellBase.hxx @@ -188,7 +188,6 @@ public: virtual void WriteUserData (String&, BOOL bBrowse = FALSE); virtual void ReadUserData (const String&, BOOL bBrowse = FALSE); virtual SdrView* GetDrawView (void) const; - virtual void EnterStandardMode(); virtual void AdjustPosSizePixel (const Point &rOfs, const Size &rSize); /** When is given, then the mouse shape is set to hour glass (or diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index ff373da66579..c748ffbc05e0 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -1003,18 +1003,6 @@ SdrView* ViewShellBase::GetDrawView (void) const -void ViewShellBase::EnterStandardMode() -{ - SdrView* pView = GetDrawView(); - // finish text editing - if ( pView && pView->IsTextEdit() ) - pView->SdrEndTextEdit(); - // more? -} - - - - void ViewShellBase::AdjustPosSizePixel (const Point &rOfs, const Size &rSize) { SfxViewShell::AdjustPosSizePixel (rOfs, rSize); -- cgit From 9038f2df89df7d22923c70765eded694204559dc Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 26 Nov 2010 11:49:51 +0100 Subject: undoapi: support for (simple) marks on the Undo stack --- sd/source/ui/view/outlview.cxx | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index e012da280103..ee2ac158bffa 100755 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1849,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 @@ -1861,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; } @@ -1870,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 ) ) { @@ -1881,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 ::svl::IUndoManager* pDocUndoManager = mpDocSh->GetUndoManager(); - if( pDocUndoManager && ( pListAction->aUndoActions.Count() == 1 )) + 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 && @@ -1908,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; @@ -1926,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(); -- cgit