summaryrefslogtreecommitdiff
path: root/sc/source/core
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-05-17 23:33:30 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-05-20 20:19:27 -0400
commitfc470416281b92e6b481885b64d59bc01ea4c3a6 (patch)
tree903c5ac743aa85231e9c216b0fac428eb8f6fb71 /sc/source/core
parentc2e28f50354d4e95b2202aebe1764d81fdbfd27e (diff)
A bit of cleanup before refactoring.
Change-Id: I3627a83669b6a69c299aef96b8b2ead1352eabe2
Diffstat (limited to 'sc/source/core')
-rw-r--r--sc/source/core/data/formulacell.cxx49
1 files changed, 14 insertions, 35 deletions
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index b243ea2afd9d..30810dfabd72 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