[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Jan 3 18:38:23 PST 2012
sc/source/core/tool/detfunc.cxx | 6 +++++-
sc/source/core/tool/reftokenhelper.cxx | 17 +++--------------
2 files changed, 8 insertions(+), 15 deletions(-)
New commits:
commit ff81615f0a09a6cf3fafee70af362b708c7ed8d0
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Tue Jan 3 20:24:40 2012 -0500
Get the reference jump feature to work with relative references.
By 'reference jump feature' I mean Ctrl-[ and Ctrl-].
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 75fe312..567ba49 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -1422,6 +1422,7 @@ void ScDetectiveFunc::GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken())
{
ScTokenRef pRef(static_cast<ScToken*>(p->Clone()));
+ pRef->CalcAbsIfRel(aCellIter.GetPos());
ScRefTokenHelper::join(rRefTokens, pRef);
}
}
@@ -1444,10 +1445,13 @@ void ScDetectiveFunc::GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
ScDetectiveRefIter aRefIter(pFCell);
for (ScToken* p = aRefIter.GetNextRefToken(); p; p = aRefIter.GetNextRefToken())
{
+ ScAddress aPos = aCellIter.GetPos();
ScTokenRef pRef(static_cast<ScToken*>(p->Clone()));
+ pRef->CalcAbsIfRel(aPos);
if (ScRefTokenHelper::intersects(aSrcRange, pRef))
{
- pRef = ScRefTokenHelper::createRefToken(aCellIter.GetPos());
+ // This address is absolute.
+ pRef = ScRefTokenHelper::createRefToken(aPos);
ScRefTokenHelper::join(rRefTokens, pRef);
}
}
diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx
index 1d966f1..364556c 100644
--- a/sc/source/core/tool/reftokenhelper.cxx
+++ b/sc/source/core/tool/reftokenhelper.cxx
@@ -141,20 +141,9 @@ namespace {
//may return a relative address
void singleRefToAddr(const ScSingleRefData& rRef, ScAddress& rAddr)
{
- if (rRef.IsColRel())
- rAddr.SetCol(rRef.nRelCol);
- else
- rAddr.SetCol(rRef.nCol);
-
- if (rRef.IsRowRel())
- rAddr.SetRow(rRef.nRelRow);
- else
- rAddr.SetRow(rRef.nRow);
-
- if (rRef.IsTabRel())
- rAddr.SetTab(rRef.nRelTab);
- else
- rAddr.SetTab(rRef.nTab);
+ rAddr.SetCol(rRef.nCol);
+ rAddr.SetRow(rRef.nRow);
+ rAddr.SetTab(rRef.nTab);
}
//returns an absolute address in reference to rPos
More information about the Libreoffice-commits
mailing list