summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-21 12:50:52 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-22 21:49:21 -0400
commit38df6bbbbe23444732b07e438887b6863a8ad1e8 (patch)
treea5b4e226036d952cc3ffcc2c3fe209522d3c6d48 /sc
parentRemove unused methods. (diff)
downloadcore-38df6bbbbe23444732b07e438887b6863a8ad1e8.tar.gz
core-38df6bbbbe23444732b07e438887b6863a8ad1e8.zip
More on reducing use of ScDocument::PutCell().
Change-Id: Ibcbb8690c96c176a31563e7b833fa66412888cb6
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/lotus/op.cxx31
-rw-r--r--sc/source/filter/qpro/qpro.cxx11
-rw-r--r--sc/source/filter/starcalc/scflt.cxx3
3 files changed, 22 insertions, 23 deletions
diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 8668c9e17612..5ed25643f682 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -93,8 +93,8 @@ void OP_Integer( SvStream& r, sal_uInt16 /*n*/ )
if (ValidColRow( static_cast<SCCOL>(nCol), nRow))
{
- ScValueCell* pZelle = new ScValueCell( ( double ) nValue );
- pDoc->PutCell( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab, pZelle, true );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetValue(ScAddress(nCol,nRow,nTab), static_cast<double>(nValue));
// 0 Stellen nach'm Komma!
SetFormat( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab, nFormat, 0 );
@@ -114,8 +114,8 @@ void OP_Number( SvStream& r, sal_uInt16 /*n*/ )
if (ValidColRow( static_cast<SCCOL>(nCol), nRow))
{
fValue = ::rtl::math::round( fValue, 15 );
- ScValueCell* pZelle = new ScValueCell( fValue );
- pDoc->PutCell( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab, pZelle, true );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetValue(ScAddress(nCol,nRow,nTab), fValue);
SetFormat( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab, nFormat, nDezFloat );
}
@@ -169,11 +169,10 @@ void OP_Formula( SvStream& r, sal_uInt16 /*n*/ )
if (ValidColRow( static_cast<SCCOL>(nCol), nRow))
{
- ScFormulaCell* pZelle = new ScFormulaCell( pLotusRoot->pDoc, aAddress, pErg );
-
- pZelle->AddRecalcMode( RECALCMODE_ONLOAD_ONCE );
-
- pDoc->PutCell( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab, pZelle, true );
+ ScFormulaCell* pCell = new ScFormulaCell( pLotusRoot->pDoc, aAddress, pErg );
+ pCell->AddRecalcMode( RECALCMODE_ONLOAD_ONCE );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetFormulaCell(ScAddress(nCol,nRow,nTab), pCell);
// nFormat = Standard -> Nachkommastellen wie Float
SetFormat( static_cast<SCCOL> (nCol), static_cast<SCROW> (nRow), nTab, nFormat, nDezFloat );
@@ -391,9 +390,8 @@ void OP_Number123( SvStream& r, sal_uInt16 /*n*/ )
if (ValidColRow( static_cast<SCCOL>(nCol), nRow) && nTab <= pDoc->GetMaxTableNumber())
{
double fValue = Snum32ToDouble( nValue );
-
- ScValueCell *pCell = new ScValueCell( fValue );
- pDoc->PutCell( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab), pCell, true );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetValue(ScAddress(nCol,nRow,nTab), fValue);
}
}
@@ -416,10 +414,9 @@ void OP_Formula123( SvStream& r, sal_uInt16 n )
if (ValidColRow( static_cast<SCCOL>(nCol), nRow) && nTab <= pDoc->GetMaxTableNumber())
{
ScFormulaCell* pCell = new ScFormulaCell( pLotusRoot->pDoc, aAddress, pErg );
-
pCell->AddRecalcMode( RECALCMODE_ONLOAD_ONCE );
-
- pDoc->PutCell( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab), pCell, true );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetFormulaCell(ScAddress(nCol,nRow,nTab), pCell);
}
}
@@ -433,8 +430,8 @@ void OP_IEEENumber123( SvStream& r, sal_uInt16 /*n*/ )
if (ValidColRow( static_cast<SCCOL>(nCol), nRow) && nTab <= pDoc->GetMaxTableNumber())
{
- ScValueCell *pCell = new ScValueCell(dValue);
- pDoc->PutCell( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), static_cast<SCTAB>(nTab), pCell, true );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetValue(ScAddress(nCol,nRow,nTab), dValue);
}
}
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index e292871833db..231f1e0752ae 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -82,20 +82,20 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
case 0x000d:{ // Integer cell
sal_Int16 nValue;
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue;
- ScValueCell* pInteger = new ScValueCell( ( double ) nValue );
nStyle = nStyle >> 3;
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle );
- pDoc->PutCell(nCol ,nRow, nTab ,pInteger,true);
+ pDoc->EnsureTable(nTab);
+ pDoc->SetValue(ScAddress(nCol,nRow,nTab), static_cast<double>(nValue));
}
break;
case 0x000e:{ // Floating point cell
double nValue;
*mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue;
- ScValueCell* pFloat = new ScValueCell( nValue );
nStyle = nStyle >> 3;
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle );
- pDoc->PutCell( nCol, nRow, nTab, pFloat, true );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetValue(ScAddress(nCol,nRow,nTab), nValue);
}
break;
@@ -114,7 +114,8 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
nStyle = nStyle >> 3;
pFormula->AddRecalcMode( RECALCMODE_ONLOAD_ONCE );
pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle );
- pDoc->PutCell( nCol, nRow, nTab, pFormula, true );
+ pDoc->EnsureTable(nTab);
+ pDoc->SetFormulaCell(ScAddress(nCol,nRow,nTab), pFormula);
}
}
break;
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 26811c3a84d7..445962dc8f0a 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -1672,7 +1672,8 @@ void Sc10Import::LoadCol(SCCOL Col, SCTAB Tab)
s[Len + 1] = 0;
ScFormulaCell* pCell = new ScFormulaCell( pDoc, ScAddress( Col, static_cast<SCROW> (Row), Tab ) );
pCell->SetHybridFormula( SC10TOSTRING( s ),formula::FormulaGrammar::GRAM_NATIVE );
- pDoc->PutCell( Col, static_cast<SCROW> (Row), Tab, pCell, true );
+ pDoc->EnsureTable(Tab);
+ pDoc->SetFormulaCell(ScAddress(Col,Row,Tab), pCell);
break;
}
case ctNote :