From 9a6c350d8dff4b5228ec7451006115e387f819f2 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 9 Sep 2022 12:54:14 +0200 Subject: Resolves: tdf#150312 Move base-cell-address to a valid sheet upon deletion ... and adjust references accordingly. For ScTokenArray::AdjustReferenceOnDeletedTab() that now also moves the base of the first deleted sheet not only after, which was a one-off before. Change-Id: I4c19e8b8a7318ba03b6a7d0b2dfaae5d05a51a29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139720 Reviewed-by: Eike Rathke Tested-by: Jenkins --- sc/inc/rangeutl.hxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sc/inc') diff --git a/sc/inc/rangeutl.hxx b/sc/inc/rangeutl.hxx index 33f531444280..4524226e43ca 100644 --- a/sc/inc/rangeutl.hxx +++ b/sc/inc/rangeutl.hxx @@ -276,6 +276,15 @@ struct SC_DLLPUBLIC ScRangeUpdater ScRangeUpdater() = delete; static void UpdateInsertTab(ScAddress& rAddr, const sc::RefUpdateInsertTabContext& rCxt); + + /** This is for the base-cell-address of a defined name or conditional + format, not for references. A sheet position on or after the start of + the deleted range is moved towards the beginning by the amount of + deleted sheets, within the deleted range to the front of that or set to + 0 (as there is always at least one sheet in a document) if the position + would result in a negative value, e.g. if position was 0 and (only) + sheet 0 is deleted it would had become -1. + */ static void UpdateDeleteTab(ScAddress& rAddr, const sc::RefUpdateDeleteTabContext& rCxt); }; -- cgit