summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2011-02-03 15:53:56 +0100
committerMathias Bauer <mba@openoffice.org>2011-02-03 15:53:56 +0100
commit76f355864a8c03b64ebfc71139f525a1fc25836a (patch)
tree189737059bcece8ceacb7abf0c1e3834caa123c5 /sc/source/ui/view
parent894985ff00c217013cc360a77108fc68cd8647e7 (diff)
parent0ceb085ea2b49234664765161095f2e5911e2b3b (diff)
CWS gnumake3: resync to m99
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r--sc/source/ui/view/auditsh.cxx2
-rw-r--r--sc/source/ui/view/dbfunc.cxx5
-rw-r--r--[-rwxr-xr-x]sc/source/ui/view/dbfunc3.cxx2
-rw-r--r--sc/source/ui/view/drawview.cxx2
-rw-r--r--sc/source/ui/view/editsh.cxx2
-rw-r--r--sc/source/ui/view/formatsh.cxx2
-rw-r--r--sc/source/ui/view/gridwin.cxx2
-rw-r--r--sc/source/ui/view/pgbrksh.cxx2
-rw-r--r--sc/source/ui/view/pivotsh.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh4.cxx4
-rw-r--r--sc/source/ui/view/tabvwsha.cxx87
-rw-r--r--sc/source/ui/view/tabvwshb.cxx95
-rw-r--r--sc/source/ui/view/tabvwshe.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx2
-rw-r--r--sc/source/ui/view/viewfun3.cxx4
15 files changed, 115 insertions, 102 deletions
diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx
index 2c80c154759d..ea081b6f2fa6 100644
--- a/sc/source/ui/view/auditsh.cxx
+++ b/sc/source/ui/view/auditsh.cxx
@@ -68,7 +68,7 @@ ScAuditingShell::ScAuditingShell(ScViewData* pData) :
nFunction( SID_FILL_ADD_PRED )
{
SetPool( &pViewData->GetViewShell()->GetPool() );
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index 1e5a6b9da4ae..f2a277b987df 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -159,7 +159,10 @@ ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode, ScGetDBSelection e
ScDocument* pDoc = pDocSh->GetDocument();
SCCOL nCol1 = aRange.aStart.Col(), nCol2 = aRange.aEnd.Col();
SCROW nRow1 = aRange.aStart.Row(), nRow2 = aRange.aEnd.Row();
- if (pDoc->ShrinkToUsedDataArea( aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly))
+ bool bShrunk;
+ pDoc->ShrinkToUsedDataArea( bShrunk, aRange.aStart.Tab(),
+ nCol1, nRow1, nCol2, nRow2, bShrinkColumnsOnly);
+ if (bShrunk)
{
aRange.aStart.SetCol(nCol1);
aRange.aEnd.SetCol(nCol2);
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index dbdeae1ae0b1..1ac653f88b70 100755..100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -2187,7 +2187,7 @@ void ScDBFunc::ShowDataPilotSourceData( ScDPObject& rDPObj, const Sequence<sheet
pInsDoc->GetCellArea( nNewTab, nEndCol, nEndRow );
pInsDoc->SetClipArea( ScRange( 0, 0, nNewTab, nEndCol, nEndRow, nNewTab ) );
- SfxUndoManager* pMgr = GetViewData()->GetDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = GetViewData()->GetDocShell()->GetUndoManager();
String aUndo = ScGlobal::GetRscString( STR_UNDO_DOOUTLINE );
pMgr->EnterListAction( aUndo, aUndo );
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 3307398b5ef8..1d748246a1d6 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -763,7 +763,7 @@ void ScDrawView::DeleteMarked()
(void)pCaptObj; // prevent 'unused variable' compiler warning in pro builds
ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer();
ScDocShell* pDocShell = pViewData ? pViewData->GetDocShell() : 0;
- SfxUndoManager* pUndoMgr = pDocShell ? pDocShell->GetUndoManager() : 0;
+ ::svl::IUndoManager* pUndoMgr = pDocShell ? pDocShell->GetUndoManager() : 0;
bool bUndo = pDrawLayer && pDocShell && pUndoMgr && pDoc->IsUndoEnabled();
// remove the cell note from document, we are its owner now
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 848a0a3c7636..269017804c3c 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1174,7 +1174,7 @@ void ScEditShell::GetUndoState(SfxItemSet &rSet)
EditView* pTopView = pHdl->GetTopView();
if (pTopView)
{
- SfxUndoManager& rTopMgr = pTopView->GetEditEngine()->GetUndoManager();
+ ::svl::IUndoManager& rTopMgr = pTopView->GetEditEngine()->GetUndoManager();
if ( rTopMgr.GetUndoActionCount() == 0 )
rSet.DisableItem( SID_UNDO );
if ( rTopMgr.GetRedoActionCount() == 0 )
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 9c891675fad5..3badf7dc1faf 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -158,7 +158,7 @@ ScFormatShell::ScFormatShell(ScViewData* pData) :
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
SetPool( &pTabViewShell->GetPool() );
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 0f07b8772254..d7f0be025574 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1884,7 +1884,7 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt )
if (nMouseStatus == SC_GM_WATERUNDO) // Undo im Giesskannenmodus
{
- SfxUndoManager* pMgr = pViewData->GetDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetDocShell()->GetUndoManager();
if ( pMgr->GetUndoActionCount() && pMgr->GetUndoActionId() == STR_UNDO_APPLYCELLSTYLE )
pMgr->Undo();
else
diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx
index 0e792b2bb279..d5e3450f3e5a 100644
--- a/sc/source/ui/view/pgbrksh.cxx
+++ b/sc/source/ui/view/pgbrksh.cxx
@@ -67,7 +67,7 @@ ScPageBreakShell::ScPageBreakShell( ScTabViewShell* pViewSh ) :
{
SetPool( &pViewSh->GetPool() );
ScViewData* pViewData = pViewSh->GetViewData();
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index a65f86ffed2c..b7f2e2234438 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -76,7 +76,7 @@ ScPivotShell::ScPivotShell( ScTabViewShell* pViewSh ) :
{
SetPool( &pViewSh->GetPool() );
ScViewData* pViewData = pViewSh->GetViewData();
- SfxUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pViewData->GetSfxDocShell()->GetUndoManager();
SetUndoManager( pMgr );
if ( !pViewData->GetDocument()->IsUndoEnabled() )
{
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 4596880b7fb6..f23ed39b34c5 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1116,7 +1116,7 @@ BOOL ScTabViewShell::IsAuditShell() const
return ( pAuditingShell && ( GetMySubShell() == pAuditingShell ) );
}
-void ScTabViewShell::SetDrawTextUndo( SfxUndoManager* pNewUndoMgr )
+void ScTabViewShell::SetDrawTextUndo( ::svl::IUndoManager* pNewUndoMgr )
{
// Default: Undo-Manager der DocShell
if (!pNewUndoMgr)
@@ -1640,7 +1640,7 @@ void ScTabViewShell::Construct( BYTE nForceDesignMode )
MakeDrawView( nForceDesignMode );
ViewOptionsHasChanged(FALSE); // legt auch evtl. DrawView an
- SfxUndoManager* pMgr = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pMgr = pDocSh->GetUndoManager();
SetUndoManager( pMgr );
pFormShell->SetUndoManager( pMgr );
if ( !pDoc->IsUndoEnabled() )
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 7734f3e24ff8..9700fe3dca3f 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -34,7 +34,6 @@
#define _ZFORLIST_DECLARE_TABLE
#include "scitems.hxx"
-#include <svl/slstitm.hxx>
#include <svl/stritem.hxx>
#include <svl/whiter.hxx>
#include <svl/zformat.hxx>
@@ -738,92 +737,6 @@ void __EXPORT ScTabViewShell::GetSaveState( SfxItemSet& rSet )
//------------------------------------------------------------------
-void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
-{
- SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
- SfxUndoManager* pUndoManager = pSh->GetUndoManager();
-
- const SfxItemSet* pReqArgs = rReq.GetArgs();
- ScDocShell* pDocSh = GetViewData()->GetDocShell();
-
- USHORT nSlot = rReq.GetSlot();
- switch ( nSlot )
- {
- case SID_UNDO:
- case SID_REDO:
- if ( pUndoManager )
- {
- BOOL bIsUndo = ( nSlot == SID_UNDO );
-
- USHORT nCount = 1;
- const SfxPoolItem* pItem;
- if ( pReqArgs && pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
- nCount = ((const SfxUInt16Item*)pItem)->GetValue();
-
- // lock paint for more than one cell undo action (not for editing within a cell)
- BOOL bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() );
- if ( bLockPaint )
- pDocSh->LockPaint();
-
- for (USHORT i=0; i<nCount; i++)
- {
- if ( bIsUndo )
- pUndoManager->Undo(0);
- else
- pUndoManager->Redo(0);
- }
-
- if ( bLockPaint )
- pDocSh->UnlockPaint();
-
- GetViewFrame()->GetBindings().InvalidateAll(sal_False);
- }
- break;
-// default:
-// GetViewFrame()->ExecuteSlot( rReq );
- }
-}
-
-void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
-{
- SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
- SfxUndoManager* pUndoManager = pSh->GetUndoManager();
-
- SfxWhichIter aIter(rSet);
- USHORT nWhich = aIter.FirstWhich();
- while ( nWhich )
- {
- switch (nWhich)
- {
- case SID_GETUNDOSTRINGS:
- case SID_GETREDOSTRINGS:
- {
- SfxStringListItem aStrLst( nWhich );
- if ( pUndoManager )
- {
- List* pList = aStrLst.GetList();
- BOOL bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
- USHORT nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
- for (USHORT i=0; i<nCount; i++)
- pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
- pUndoManager->GetRedoActionComment(i) ),
- LIST_APPEND );
- }
- rSet.Put( aStrLst );
- }
- break;
- default:
- // get state from sfx view frame
- GetViewFrame()->GetSlotState( nWhich, NULL, &rSet );
- }
-
- nWhich = aIter.NextWhich();
- }
-}
-
-
-//------------------------------------------------------------------
-
void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq )
{
ScViewOptions aViewOptions = GetViewData()->GetOptions();
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index c6d9b004b9ba..b13707a8378b 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -61,9 +61,11 @@
#include <sfx2/viewfrm.hxx>
#include <svtools/soerr.hxx>
#include <svl/rectitem.hxx>
+#include <svl/slstitm.hxx>
#include <svl/whiter.hxx>
#include <unotools/moduleoptions.hxx>
#include <sot/exchange.hxx>
+#include <tools/diagnose_ex.h>
#include "tabvwsh.hxx"
#include "globstr.hrc"
@@ -487,5 +489,98 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet)
}
+//------------------------------------------------------------------
+
+void ScTabViewShell::ExecuteUndo(SfxRequest& rReq)
+{
+ SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ ::svl::IUndoManager* pUndoManager = pSh->GetUndoManager();
+
+ const SfxItemSet* pReqArgs = rReq.GetArgs();
+ ScDocShell* pDocSh = GetViewData()->GetDocShell();
+
+ USHORT nSlot = rReq.GetSlot();
+ switch ( nSlot )
+ {
+ case SID_UNDO:
+ case SID_REDO:
+ if ( pUndoManager )
+ {
+ BOOL bIsUndo = ( nSlot == SID_UNDO );
+
+ USHORT nCount = 1;
+ const SfxPoolItem* pItem;
+ if ( pReqArgs && pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET )
+ nCount = ((const SfxUInt16Item*)pItem)->GetValue();
+
+ // lock paint for more than one cell undo action (not for editing within a cell)
+ BOOL bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() );
+ if ( bLockPaint )
+ pDocSh->LockPaint();
+
+ try
+ {
+ for (USHORT i=0; i<nCount; i++)
+ {
+ if ( bIsUndo )
+ pUndoManager->Undo();
+ else
+ pUndoManager->Redo();
+ }
+ }
+ catch ( const uno::Exception& )
+ {
+ // no need to handle. By definition, the UndoManager handled this by clearing the
+ // Undo/Redo stacks
+ }
+
+ if ( bLockPaint )
+ pDocSh->UnlockPaint();
+
+ GetViewFrame()->GetBindings().InvalidateAll(sal_False);
+ }
+ break;
+// default:
+// GetViewFrame()->ExecuteSlot( rReq );
+ }
+}
+
+void ScTabViewShell::GetUndoState(SfxItemSet &rSet)
+{
+ SfxShell* pSh = GetViewData()->GetDispatcher().GetShell(0);
+ ::svl::IUndoManager* pUndoManager = pSh->GetUndoManager();
+
+ SfxWhichIter aIter(rSet);
+ USHORT nWhich = aIter.FirstWhich();
+ while ( nWhich )
+ {
+ switch (nWhich)
+ {
+ case SID_GETUNDOSTRINGS:
+ case SID_GETREDOSTRINGS:
+ {
+ SfxStringListItem aStrLst( nWhich );
+ if ( pUndoManager )
+ {
+ List* pList = aStrLst.GetList();
+ BOOL bIsUndo = ( nWhich == SID_GETUNDOSTRINGS );
+ size_t nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount();
+ for (size_t i=0; i<nCount; i++)
+ pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) :
+ pUndoManager->GetRedoActionComment(i) ),
+ LIST_APPEND );
+ }
+ rSet.Put( aStrLst );
+ }
+ break;
+ default:
+ // get state from sfx view frame
+ GetViewFrame()->GetSlotState( nWhich, NULL, &rSet );
+ }
+
+ nWhich = aIter.NextWhich();
+ }
+}
+
diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx
index c0af39226c3f..6034ac81ecba 100644
--- a/sc/source/ui/view/tabvwshe.cxx
+++ b/sc/source/ui/view/tabvwshe.cxx
@@ -97,7 +97,9 @@ String __EXPORT ScTabViewShell::GetSelectionText( BOOL bWholeWord )
SCROW nRow1, nRow2;
SCTAB nTab1, nTab2;
aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
- if (pDoc->ShrinkToUsedDataArea( nTab1, nCol1, nRow1, nCol2, nRow2, false))
+ bool bShrunk;
+ pDoc->ShrinkToUsedDataArea( bShrunk, nTab1, nCol1, nRow1, nCol2, nRow2, false);
+ if (bShrunk)
{
aRange.aStart.SetCol( nCol1 );
aRange.aStart.SetRow( nRow1 );
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 37c1b0ab1e84..b192182a26aa 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -675,7 +675,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
{
// handle several sheets
- SfxUndoManager* pUndoManager = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoManager = pDocSh->GetUndoManager();
String aUndo = ScGlobal::GetRscString( STR_UNDO_TAB_RTL );
pUndoManager->EnterListAction( aUndo, aUndo );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index f7a126c2dac8..0dc77a19121c 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1009,7 +1009,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
ScDocument* pDoc = GetViewData()->GetDocument();
ScDocShell* pDocSh = GetViewData()->GetDocShell();
ScMarkData& rMark = GetViewData()->GetMarkData();
- SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
const BOOL bRecord(pDoc->IsUndoEnabled());
ScDocShellModificator aModificator( *pDocSh );
@@ -1635,7 +1635,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
if (pDoc->IsUndoEnabled())
{
- SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager();
+ ::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager();
String aUndo = ScGlobal::GetRscString(
pClipDoc->IsCutMode() ? STR_UNDO_CUT : STR_UNDO_COPY);
pUndoMgr->EnterListAction(aUndo, aUndo);