summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-07-23 09:50:10 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-07-24 23:29:38 -0400
commit0e7f4c9c7d5d2a341448b9a7186b0cd972d0f8c0 (patch)
treea229e1ca390ddee5a1ece76ca419cc95b4139532 /sc
parent4c8f7c0977c30258e6542d0ea070e060958abeb6 (diff)
More on removing use of CalcRelFromAbs().
Some of them were called for all absolute references, which is not necessary. Change-Id: If19ee74731f40ca208e1cc1804c6b6e53073d891
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column3.cxx1
-rw-r--r--sc/source/core/data/table2.cxx1
-rw-r--r--sc/source/core/tool/consoli.cxx16
3 files changed, 6 insertions, 12 deletions
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 83592fe1900d..1e0ec16339e4 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -920,7 +920,6 @@ void ScColumn::CopyFromClip(
aRef.nRow = nDestRow - nDy; // Source row
aDestPos.SetRow( nDestRow );
- aRef.CalcRelFromAbs( aDestPos );
ScTokenArray aArr;
aArr.AddSingleReference( aRef );
SetFormulaCell(nDestRow, new ScFormulaCell(pDocument, aDestPos, &aArr));
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index f54912bce8d6..96839f10f903 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -975,7 +975,6 @@ void ScTable::TransposeClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
aRef.nTab = nTab;
aRef.InitFlags(); // -> all absolute
aRef.SetFlag3D(true);
- aRef.CalcRelFromAbs( aDestPos );
ScTokenArray aArr;
aArr.AddSingleReference( aRef );
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index 5f053832a6c2..f7795caf36a8 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -708,8 +708,8 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
String aString;
ScSingleRefData aSRef; // Daten fuer Referenz-Formelzellen
- aSRef.InitFlags();
- aSRef.SetFlag3D(sal_True);
+ aSRef.InitFlags(); // This reference is absolute at all times.
+ aSRef.SetFlag3D(true);
ScComplexRefData aCRef; // Daten fuer Summen-Zellen
aCRef.InitFlags();
@@ -741,9 +741,7 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
{
// Referenz einfuegen (absolut, 3d)
- aSRef.nCol = aRef.nCol;
- aSRef.nRow = aRef.nRow;
- aSRef.nTab = aRef.nTab;
+ aSRef.SetAddress(ScAddress(aRef.nCol,aRef.nRow,aRef.nTab), ScAddress());
ScTokenArray aRefArr;
aRefArr.AddSingleReference(aSRef);
@@ -760,11 +758,9 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow,
ScAddress aDest( sal::static_int_cast<SCCOL>(nCol+nArrX),
sal::static_int_cast<SCROW>(nRow+nArrY+nNeeded), nTab );
- aCRef.Ref1.nTab = aCRef.Ref2.nTab = nTab;
- aCRef.Ref1.nCol = aCRef.Ref2.nCol = sal::static_int_cast<SCsCOL>( nCol+nArrX );
- aCRef.Ref1.nRow = nRow+nArrY;
- aCRef.Ref2.nRow = nRow+nArrY+nNeeded-1;
- aCRef.CalcRelFromAbs( aDest );
+ ScRange aRange(sal::static_int_cast<SCCOL>(nCol+nArrX), nRow+nArrY, nTab);
+ aRange.aEnd.SetRow(nRow+nArrY+nNeeded-1);
+ aCRef.SetRange(aRange, aDest);
ScTokenArray aArr;
aArr.AddOpCode(eOpCode); // ausgewaehlte Funktion