summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-08-17 12:22:09 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-08-22 09:24:06 +0200
commit826b2d68ee3985144e68966dc29bb3433d22b4d5 (patch)
tree4806313a6d421ae22e96471a187572eefdadf417
parent22dbd5904f4f69d98530fecdd9e4383dd088f76f (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> (cherry picked from commit da0dc858fc05e7f1d6a60ca61f722044e688d4f8) Reviewed-on: https://gerrit.libreoffice.org/59271 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@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 691188f80d33..8d6fd7351aa2 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3891,6 +3891,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.
@@ -3913,10 +3918,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);
@@ -3973,10 +3974,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);