[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Tue Jul 23 06:48:43 PDT 2013
sc/source/core/data/column3.cxx | 1 -
sc/source/core/data/table2.cxx | 1 -
sc/source/core/tool/consoli.cxx | 16 ++++++----------
3 files changed, 6 insertions(+), 12 deletions(-)
New commits:
commit 3346bbca14734129ddd1900570b1c28afcc553db
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Jul 23 09:50:10 2013 -0400
More on removing use of CalcRelFromAbs().
Some of them were called for all absolute references, which is not
necessary.
Change-Id: If19ee74731f40ca208e1cc1804c6b6e53073d891
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 83592fe..1e0ec16 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 f54912b..96839f1 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 5f05383..f7795ca 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
More information about the Libreoffice-commits
mailing list