sc/source/core/data/conditio.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
New commits: commit 50cd4c73eba1ae2802a4897410bd3f75516d0dcb Author: Eike Rathke <er...@redhat.com> AuthorDate: Wed Jun 26 18:33:07 2019 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Wed Jun 26 23:24:13 2019 +0200 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 <er...@redhat.com> Tested-by: Jenkins 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits