summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/tool/token.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 99775f5de4b6..8f9e9a67b002 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3389,9 +3389,12 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
SCTAB nOldTab = (*pp)->GetSheet();
if (isNameModified(rCxt.maUpdatedNames, nOldTab, **pp))
aRes.mbNameModified = true;
- if (rCxt.mnTabDelta &&
- rCxt.maRange.aStart.Tab() <= nOldTab && nOldTab <= rCxt.maRange.aEnd.Tab())
+ if (rCxt.mnTabDelta && aOldRange.In(rOldPos) &&
+ aOldRange.aStart.Tab() <= nOldTab && nOldTab <= aOldRange.aEnd.Tab())
{
+ /* TODO: this may not be needed at all anymore;
+ * investigate when we actually hit the
+ * condition. */
aRes.mbNameModified = true;
(*pp)->SetSheet( nOldTab + rCxt.mnTabDelta);
}