From c4a3e29626126658cfb9e8755e9f98cfc4500abd Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 23 Nov 2011 21:32:01 -0500 Subject: Reducing header dependency on markdata.hxx. --- sc/source/ui/undo/undodat.cxx | 9 +++++---- sc/source/ui/undo/undotab.cxx | 7 ++++--- sc/source/ui/undo/undoutil.cxx | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'sc/source/ui/undo') diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index 2f3edf7e927c..da3617b623e5 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -56,6 +56,7 @@ #include "sc.hrc" #include "chgtrack.hxx" // Amelia Wang #include "refundo.hxx" // Amelia Wang +#include "markdata.hxx" // ----------------------------------------------------------------------- @@ -2030,7 +2031,7 @@ ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell, void* /*pFill1*/, void* /*pFill2*/, void* /*pFill3*/, sal_Bool bRedoIsFilled ) : ScBlockUndo( pNewDocShell, ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), SC_UNDO_SIMPLE ), - aMarkData( rMark ), + mpMarkData(new ScMarkData(rMark)), pUndoDoc( pNewUndoDoc ), pRedoDoc( pNewRedoDoc ), nFlags( nNewFlags ), @@ -2042,8 +2043,8 @@ ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell, // don't have to be changed and branched for 641. // They can be removed later. - if ( !aMarkData.IsMarked() ) // no cell marked: - aMarkData.SetMarkArea( aBlockRange ); // mark paste block + if (!mpMarkData->IsMarked()) // no cell marked: + mpMarkData->SetMarkArea(aBlockRange); // mark paste block if ( pRefUndoData ) pRefUndoData->DeleteUnchanged( pDocShell->GetDocument() ); @@ -2136,7 +2137,7 @@ void ScUndoDataForm::DoChange( const sal_Bool bUndo ) sal_Bool bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==MAXCOL ); pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); - pRedoDoc->InitUndoSelected( pDoc, aMarkData, bColInfo, bRowInfo ); + pRedoDoc->InitUndoSelected( pDoc, *mpMarkData, bColInfo, bRowInfo ); } // read "redo" data from the document in the first undo // all sheets - CopyToDocument skips those that don't exist in pRedoDoc diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 0dc6c48d1d18..ae60b01e118f 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -50,6 +50,7 @@ #include "tabprotection.hxx" #include "viewdata.hxx" #include "progress.hxx" +#include "markdata.hxx" // for ScUndoRenameObject - might me moved to another file later #include @@ -857,13 +858,13 @@ ScUndoMakeScenario::ScUndoMakeScenario( ScDocShell* pNewDocShell, const Color& rCol, sal_uInt16 nF, const ScMarkData& rMark ) : ScSimpleUndo( pNewDocShell ), + mpMarkData(new ScMarkData(rMark)), nSrcTab( nSrc ), nDestTab( nDest ), aName( rN ), aComment( rC ), aColor( rCol ), nFlags( nF ), - aMarkData( rMark ), pDrawUndo( NULL ) { pDrawUndo = GetSdrUndoAction( pDocShell->GetDocument() ); @@ -906,14 +907,14 @@ void ScUndoMakeScenario::Undo() void ScUndoMakeScenario::Redo() { - SetViewMarkData( aMarkData ); + SetViewMarkData(*mpMarkData); RedoSdrUndoAction( pDrawUndo ); // Draw Redo first pDocShell->SetInUndo( sal_True ); bDrawIsInUndo = sal_True; - pDocShell->MakeScenario( nSrcTab, aName, aComment, aColor, nFlags, aMarkData, false ); + pDocShell->MakeScenario( nSrcTab, aName, aComment, aColor, nFlags, *mpMarkData, false ); bDrawIsInUndo = false; pDocShell->SetInUndo( false ); diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx index e453c0ab9b67..a1fcc23b8cde 100644 --- a/sc/source/ui/undo/undoutil.cxx +++ b/sc/source/ui/undo/undoutil.cxx @@ -44,6 +44,7 @@ #include "globstr.hrc" #include "globalnames.hxx" #include "global.hxx" +#include "markdata.hxx" void ScUndoUtil::MarkSimpleBlock( ScDocShell* pDocShell, SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, -- cgit