Resolves: tdf#130370 Increment sheet-local name only for moved cells
Probably that piece of code is not needed at all anymore since
moving entire sheets and their names is handled differently
nowadays. Needs further investigation.
Change-Id: I2ac115c18354371d0abbfc6cc972d16edcb41021
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88898
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 99775f5..8f9e9a6 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);
}