diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 09:41:42 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-22 21:49:24 -0400 |
commit | 6dfdce83578ce44720e4cf1d84c6e4ef50686983 (patch) | |
tree | 0e6cefe3a7b4046c6f83d67a79b7983e9e19f734 /sc/source | |
parent | d4c36b6cc3d45f0d66cc3d0d86d3d842b979cbd7 (diff) |
Remove a variant of PutCell().
Change-Id: I6100d30954536a3683be69363f1fc13d54cacfef
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/cell2.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 22 | ||||
-rw-r--r-- | sc/source/core/data/table6.cxx | 15 | ||||
-rw-r--r-- | sc/source/ui/app/transobj.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/undo/undocell.cxx | 4 |
5 files changed, 16 insertions, 28 deletions
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index 5bd38466b13b..0e217f2e19bb 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -1442,7 +1442,7 @@ void ScFormulaCell::UpdateTranspose( const ScRange& rSource, const ScAddress& rD ScFormulaCell* pFCell = new ScFormulaCell( pUndoDoc, aPos, pOld, eTempGrammar, cMatrixFlag); pFCell->aResult.SetToken( NULL); // to recognize it as changed later (Cut/Paste!) - pUndoDoc->PutCell( aPos.Col(), aPos.Row(), aPos.Tab(), pFCell ); + pUndoDoc->SetFormulaCell(aPos, pFCell); } bCompile = true; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index d5ceb089bbc5..7064ee2ddb60 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2925,28 +2925,6 @@ void ScDocument::FillTabMarked( SCTAB nSrcTab, const ScMarkData& rMark, } } - -void ScDocument::PutCell( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell, bool bForceTab ) -{ - if (ValidTab(nTab)) - { - if ( bForceTab && ( nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab]) ) - { - bool bExtras = !bIsUndo; // Spaltenbreiten, Zeilenhoehen, Flags - - if (nTab >= static_cast<SCTAB>(maTabs.size())) - maTabs.resize(nTab + 1,NULL); - maTabs[nTab] = new ScTable(this, nTab, - OUString("temp"), - bExtras, bExtras); - } - - if (maTabs[nTab]) - maTabs[nTab]->PutCell( nCol, nRow, pCell ); - } -} - - void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, bool bForceTab ) { SCTAB nTab = rPos.Tab(); diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 640ed59e7cbd..6df2249d89a4 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -31,6 +31,7 @@ #include "editutil.hxx" #include "detfunc.hxx" #include "postit.hxx" +#include "stringutil.hxx" //-------------------------------------------------------------------------- @@ -966,10 +967,14 @@ bool ScTable::SearchRangeForAllEmptyCells( { aCol[nCol].Insert(i, new ScStringCell(rNewStr)); if (pUndoDoc) + { // TODO: I'm using a string cell with empty content to // trigger deletion of cell instance on undo. Maybe I // should create a new cell type for this? - pUndoDoc->PutCell(nCol, i, nTab, new ScStringCell(String())); + ScSetStringParam aParam; + aParam.setTextInput(); + pUndoDoc->SetString(ScAddress(nCol, i, nTab), EMPTY_OUSTRING); + } } rUndoStr = String(); } @@ -999,10 +1004,14 @@ bool ScTable::SearchRangeForAllEmptyCells( { aCol[nCol].Insert(nRow, new ScStringCell(rSearchItem.GetReplaceString())); if (pUndoDoc) + { // TODO: I'm using a string cell with empty content to // trigger deletion of cell instance on undo. Maybe I // should create a new cell type for this? - pUndoDoc->PutCell(nCol, nRow, nTab, new ScStringCell(String())); + ScSetStringParam aParam; + aParam.setTextInput(); + pUndoDoc->SetString(ScAddress(nCol, nRow, nTab), EMPTY_OUSTRING); + } } } else if (pCell->GetCellType() == CELLTYPE_NOTE) @@ -1015,7 +1024,7 @@ bool ScTable::SearchRangeForAllEmptyCells( if (pUndoDoc) { ScAddress aCellPos(nCol, nRow, nTab); - pUndoDoc->PutCell(nCol, nRow, nTab, pCell->Clone(*pUndoDoc, aCellPos)); + pUndoDoc->PutCell(aCellPos, pCell->Clone(*pUndoDoc, aCellPos)); ScNotes* pNotes = pUndoDoc->GetNotes(nTab); ScPostIt* pPostIt = maNotes.findByAddress(nCol, nRow); if (pPostIt) diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index bb67eef8cc48..880719548b34 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -798,7 +798,6 @@ void ScTransferObj::StripRefs( ScDocument* pDoc, SCCOL nCol = aIter.GetCol() - nSubX; SCROW nRow = aIter.GetRow() - nSubY; - ScBaseCell* pNew = 0; sal_uInt16 nErrCode = pFCell->GetErrCode(); ScAddress aPos(nCol, nRow, nDestTab); if (nErrCode) diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index 1f6163978c7a..d78ac09eaff1 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -250,7 +250,9 @@ void ScUndoEnterData::Undo() { Value& rVal = maOldValues[i]; ScBaseCell* pNewCell = rVal.mpCell ? rVal.mpCell->Clone( *pDoc, SC_CLONECELL_STARTLISTENING ) : 0; - pDoc->PutCell(maPos.Col(), maPos.Row(), rVal.mnTab, pNewCell); + ScAddress aPos = maPos; + aPos.SetTab(rVal.mnTab); + pDoc->PutCell(aPos, pNewCell); if (rVal.mbHasFormat) pDoc->ApplyAttr(maPos.Col(), maPos.Row(), rVal.mnTab, |