summaryrefslogtreecommitdiff
path: root/sc/source/core/data
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2019-06-26 18:33:07 +0200
committerEike Rathke <erack@redhat.com>2019-06-27 01:39:48 +0200
commit7b0f65cbfa3ef0b3cb698247429f445574ba3a64 (patch)
treeaa5cea021206b2387fd01348075b465e5f687ac8 /sc/source/core/data
parent6b1116125e2d298b0001a2ee9603a8cd9efbd08a (diff)
Resolves: tdf#117899 update condition entries' source position on inter-copy
Otherwise in the bug case it resulted in a source position pointing to the second sheet, which didn't exist in the clipboard target and thus writing the ODF format resulted in an empty base-cell-address which when read was source position 0,0,0 and with the [.$E3] reference yielded a relative row+2 offset instead of row+0 for a 2,0,0 base cell source position, effectively on row 3 then referencing $E5 instead of $E3. Change-Id: I4d7b373aa69363bc5eeefc3987087972fcad1393 Reviewed-on: https://gerrit.libreoffice.org/74747 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 50cd4c73eba1ae2802a4897410bd3f75516d0dcb) Reviewed-on: https://gerrit.libreoffice.org/74764
Diffstat (limited to 'sc/source/core/data')
-rw-r--r--sc/source/core/data/conditio.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index ae29cb2d8dd3..fc91c6d343e7 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1873,13 +1873,21 @@ void ScConditionalFormat::CompileXML()
void ScConditionalFormat::UpdateReference( sc::RefUpdateContext& rCxt, bool bCopyAsMove )
{
- for(auto& rxEntry : maEntries)
- rxEntry->UpdateReference(rCxt);
-
if (rCxt.meMode == URM_COPY && bCopyAsMove)
+ {
+ // ScConditionEntry::UpdateReference() obtains its aSrcPos from
+ // maRanges and does not update it on URM_COPY, but it's needed later
+ // for the moved position, so update maRanges beforehand.
maRanges.UpdateReference(URM_MOVE, pDoc, rCxt.maRange, rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
+ for (auto& rxEntry : maEntries)
+ rxEntry->UpdateReference(rCxt);
+ }
else
+ {
+ for (auto& rxEntry : maEntries)
+ rxEntry->UpdateReference(rCxt);
maRanges.UpdateReference(rCxt.meMode, pDoc, rCxt.maRange, rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
+ }
}
void ScConditionalFormat::InsertRow(SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW nRowPos, SCSIZE nSize)