summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-08-17 12:22:09 +0200
committerEike Rathke <erack@redhat.com>2018-08-17 19:24:26 +0200
commitda0dc858fc05e7f1d6a60ca61f722044e688d4f8 (patch)
tree360238ccf589b9264994789f203a9d9ab140840b
parenta0d9200fbdcf0d7c0c0155389d2954f4fa9dac32 (diff)
Resolves: tdf#118983 do not expand range if sheet references not affected
Change-Id: Ib207d3723ce1d370a953e652957aaed399affc9c Reviewed-on: https://gerrit.libreoffice.org/59255 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/tool/token.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 1e41800cb5d7..51a63f548afe 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3840,6 +3840,11 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
{
ScComplexRefData& rRef = *p->GetDoubleRef();
ScRange aAbs = rRef.toAbs(rPos);
+
+ if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab())
+ // Sheet references not affected.
+ break;
+
if (rCxt.maRange.In(aAbs))
{
// This range is entirely within the shifted region.
@@ -3862,10 +3867,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
// column range of the reference is not entirely in the deleted column range.
break;
- if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab())
- // wrong tables
- break;
-
ScRange aDeleted = rCxt.maRange;
aDeleted.aStart.IncRow(rCxt.mnRowDelta);
aDeleted.aEnd.SetRow(aDeleted.aStart.Row()-rCxt.mnRowDelta-1);
@@ -3922,10 +3923,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
// row range of the reference is not entirely in the deleted row range.
break;
- if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab())
- // wrong tables
- break;
-
ScRange aDeleted = rCxt.maRange;
aDeleted.aStart.IncCol(rCxt.mnColDelta);
aDeleted.aEnd.SetCol(aDeleted.aStart.Col()-rCxt.mnColDelta-1);