summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorCarsten Driesner <cd@openoffice.org>2011-02-07 13:06:08 +0100
committerCarsten Driesner <cd@openoffice.org>2011-02-07 13:06:08 +0100
commitdde0ca60a7619e03c7ed5a4ddacfb048dd159ab7 (patch)
tree66e5a71ff830f75382ce388b33021db01c3fd4c4 /sd/source/ui/view
parentc64664f9e281980106741fc759d2faa190009b22 (diff)
parent1a0a7970636e093d015267b828ecd8d5c2543541 (diff)
removetooltypes01: Rebase to DEV300m99
Diffstat (limited to 'sd/source/ui/view')
-rwxr-xr-xsd/source/ui/view/ViewShellImplementation.cxx4
-rwxr-xr-xsd/source/ui/view/ViewShellManager.cxx4
-rwxr-xr-xsd/source/ui/view/drviews2.cxx2
-rwxr-xr-xsd/source/ui/view/drviewsb.cxx6
-rwxr-xr-xsd/source/ui/view/outlview.cxx50
-rwxr-xr-xsd/source/ui/view/sdview.cxx2
-rwxr-xr-xsd/source/ui/view/unmodpg.cxx4
-rw-r--r--sd/source/ui/view/viewshe3.cxx4
-rwxr-xr-xsd/source/ui/view/viewshel.cxx43
9 files changed, 69 insertions, 50 deletions
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx
index a63b246401a7..613aff9fd36c 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 1c27f4fe2198..2df075662eb1 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 7c5d90f633eb..7c219331441b 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() )
{
sal_Bool bMergeUndo = sal_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 f2c7877a1476..eb3bb754698b 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( sal_uInt16 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 8dc0bfc8ccd7..020ecf11b42f 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
- sal_uInt16 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);
}
sal_uInt16 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 )
{
- sal_uInt16 nCount = pSourceList->aUndoActions.Count();
- sal_uInt16 nDestAction = pDestinationList->aUndoActions.Count();
+ sal_uInt16 nCount = pSourceList->aUndoActions.size();
+ sal_uInt16 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
- sal_uInt16 nCount = pListAction->aUndoActions.Count();
- sal_uInt16 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 6d97fdfc9068..23d57c26ad33 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 24d6d8a4b914..f88799118577 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,
sal_Bool bTheNewBckgrndVisible,
sal_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 4748206a416d..384fe3fc6b10 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(sal_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(sal_False);
if(pUndoManager)
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 8ba64e9dcf29..62ea8a71407e 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*, sal_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(sal_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(sal_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(sal_Bool, SfxRequest& rReq)
void ViewShell::ImpSidRedo(sal_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(sal_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
}
}