summaryrefslogtreecommitdiff
path: root/sc
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 19:21:09 +0200
commite6080277c586dbc9f02b9893dd561e98d76027ba (patch)
tree4d000acdb08ff99085195417207dc71d992b699f /sc
parent17cffd941e34808f311e6ebb4014759ef59308c1 (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 (cherry picked from commit f35673a825ecd4c4b331302c0408c65b9906f97f)
Diffstat (limited to 'sc')
-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 07b121c25a7d..8be239067469 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())