diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-24 14:06:32 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-24 14:06:32 +0000 |
commit | 462ebd5b18e44442e4f5dcd5f8992b719d049465 (patch) | |
tree | 368add7aa2649c91f1938a2d90400e751c7a65ba /sc | |
parent | 66a89e8ff1b7812c2d2d56b20ff4c5da19ee2d55 (diff) |
CWS-TOOLING: integrate CWS calc31stopper5_DEV300
2009-04-16 15:35:37 +0200 dr r270888 : #101118# collect all drawing undo actions while creating a cell note
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 21 | ||||
-rw-r--r-- | sc/source/ui/inc/docfunc.hxx | 4 |
2 files changed, 15 insertions, 10 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 36de4dbe0..5c15f2952 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -98,9 +98,14 @@ using namespace com::sun::star; //======================================================================== -IMPL_LINK( ScDocFunc, NotifyDrawUndo, SfxUndoAction*, pUndoAction ) +IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction ) { - rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDraw( pUndoAction, &rDocShell ) ); + // #i101118# if drawing layer collects the undo actions, add it there + ScDrawLayer* pDrawLayer = rDocShell.GetDocument()->GetDrawLayer(); + if( pDrawLayer && pDrawLayer->IsRecording() ) + pDrawLayer->AddCalcUndo( pUndoAction ); + else + rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDraw( pUndoAction, &rDocShell ) ); rDocShell.SetDrawModified(); return 0; } @@ -1523,7 +1528,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, nUndoPos ++; } } - rDocShell.GetUndoManager()->AddUndoAction( new ScUndoInsertCells( + rDocShell.GetUndoManager()->AddUndoAction( new ScUndoInsertCells( &rDocShell, ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab ), nUndoPos, pTabs, pScenarios, eCmd, pRefUndoDoc, pUndoData, bPartOfPaste ) ); } @@ -1572,7 +1577,7 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, return bSuccess; } -BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, DelCellCmd eCmd, +BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, DelCellCmd eCmd, BOOL bRecord, BOOL bApi ) { ScDocShellModificator aModificator( rDocShell ); @@ -1643,10 +1648,10 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, // Test Zellschutz SCCOL nEditTestEndX = nUndoEndX; - if ( eCmd==DEL_DELCOLS || eCmd==DEL_CELLSLEFT ) + if ( eCmd==DEL_DELCOLS || eCmd==DEL_CELLSLEFT ) nEditTestEndX = MAXCOL; SCROW nEditTestEndY = nUndoEndY; - if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP ) + if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP ) nEditTestEndY = MAXROW; ScEditableTester aTester( pDoc, nUndoStartX, nUndoStartY, nEditTestEndX, nEditTestEndY, aMark ); if (!aTester.IsEditable()) @@ -1866,9 +1871,9 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, // #i51445# old merge flag attributes must be deleted also for single cells, // not only for whole columns/rows - if ( eCmd==DEL_DELCOLS || eCmd==DEL_CELLSLEFT ) + if ( eCmd==DEL_DELCOLS || eCmd==DEL_CELLSLEFT ) nMergeTestEndX = MAXCOL; - if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP ) + if ( eCmd==DEL_DELROWS || eCmd==DEL_CELLSUP ) nMergeTestEndY = MAXROW; ScPatternAttr aPattern( pDoc->GetPool() ); aPattern.GetItemSet().Put( ScMergeFlagAttr() ); diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index 26e976fb9..2995e8110 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -37,7 +37,7 @@ #include "formula/grammar.hxx" class ScEditEngineDefaulter; -class SfxUndoAction; +class SdrUndoAction; class ScAddress; class ScDocShell; class ScMarkData; @@ -67,7 +67,7 @@ public: ScDocFunc( ScDocShell& rDocSh ): rDocShell(rDocSh) {} ~ScDocFunc() {} - DECL_LINK( NotifyDrawUndo, SfxUndoAction* ); + DECL_LINK( NotifyDrawUndo, SdrUndoAction* ); BOOL DetectiveAddPred(const ScAddress& rPos); BOOL DetectiveDelPred(const ScAddress& rPos); |