summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/token.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-21 17:50:10 +0200
committerEike Rathke <erack@redhat.com>2015-06-21 18:36:23 +0200
commitf35673a825ecd4c4b331302c0408c65b9906f97f (patch)
treeece5d23568af265c5df4cc8080c8fb28f142f661 /sc/source/core/tool/token.cxx
parent6a3c3673d2d50cc42c1b92a841306232a8cf022f (diff)
adjustSingleRefInName() handle relative column and row independently
The absolute part needs to be adjusted when the referenced column or row is moved, even if the other part is relative. Change-Id: Ibd6c2f58b7e01ced4d2e521f29295c044d27924a
Diffstat (limited to 'sc/source/core/tool/token.cxx')
-rw-r--r--sc/source/core/tool/token.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 98ecefb715f1..3585ec4a2e34 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3227,18 +3227,12 @@ bool adjustSingleRefInName(
return false;
}
- if (rRef.IsColRel() || rRef.IsRowRel())
- {
- // Adjust references only when both column and row are absolute.
- return false;
- }
-
if (!rCxt.maRange.In(rRef.toAbs(rPos)))
return false;
bool bChanged = false;
- if (rCxt.mnColDelta)
+ if (rCxt.mnColDelta && !rRef.IsColRel())
{
// Adjust absolute column reference.
if (rCxt.maRange.aStart.Col() <= rRef.Col() && rRef.Col() <= rCxt.maRange.aEnd.Col())
@@ -3248,7 +3242,7 @@ bool adjustSingleRefInName(
}
}
- if (rCxt.mnRowDelta)
+ if (rCxt.mnRowDelta && !rRef.IsRowRel())
{
// Adjust absolute row reference.
if (rCxt.maRange.aStart.Row() <= rRef.Row() && rRef.Row() <= rCxt.maRange.aEnd.Row())