[Libreoffice-commits] core.git: Branch 'feature/formula-core-rework' - sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Fri May 17 20:31:45 PDT 2013
sc/source/core/data/formulacell.cxx | 49 ++++++++++--------------------------
1 file changed, 14 insertions(+), 35 deletions(-)
New commits:
commit 8935351b3785661e13d661b39397693b4e2bdebe
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 17 23:33:30 2013 -0400
A bit of cleanup before refactoring.
Change-Id: I3627a83669b6a69c299aef96b8b2ead1352eabe2
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index b243ea2..30810df 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3188,53 +3188,32 @@ void ScFormulaCell::StartListeningTo( ScDocument* pDoc )
switch( eType )
{
case svSingleRef:
- rRef1.CalcAbsIfRel(aPos);
- if ( rRef1.Valid() )
- {
- pDoc->StartListeningCell(
- ScAddress( rRef1.nCol,
- rRef1.nRow,
- rRef1.nTab ), this );
- }
+ {
+ ScAddress aCell = rRef1.toAbs(aPos);
+ if (aCell.IsValid())
+ pDoc->StartListeningCell(aCell, this);
+ }
break;
case svDoubleRef:
- t->CalcAbsIfRel(aPos);
- if ( rRef1.Valid() && rRef2.Valid() )
+ {
+ ScAddress aCell1 = rRef1.toAbs(aPos);
+ ScAddress aCell2 = rRef2.toAbs(aPos);
+ if (aCell1.IsValid() && aCell2.IsValid())
{
- if ( t->GetOpCode() == ocColRowNameAuto )
+ if (t->GetOpCode() == ocColRowNameAuto)
{ // automagically
if ( rRef1.IsColRel() )
{ // ColName
- pDoc->StartListeningArea( ScRange (
- rRef1.nCol,
- rRef1.nRow,
- rRef1.nTab,
- rRef2.nCol,
- MAXROW,
- rRef2.nTab ), this );
+ aCell2.SetRow(MAXROW);
}
else
{ // RowName
- pDoc->StartListeningArea( ScRange (
- rRef1.nCol,
- rRef1.nRow,
- rRef1.nTab,
- MAXCOL,
- rRef2.nRow,
- rRef2.nTab ), this );
+ aCell2.SetCol(MAXCOL);
}
}
- else
- {
- pDoc->StartListeningArea( ScRange (
- rRef1.nCol,
- rRef1.nRow,
- rRef1.nTab,
- rRef2.nCol,
- rRef2.nRow,
- rRef2.nTab ), this );
- }
+ pDoc->StartListeningArea(ScRange(aCell1, aCell2), this);
}
+ }
break;
default:
; // nothing
More information about the Libreoffice-commits
mailing list