[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sc/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 26 23:40:35 UTC 2019


 sc/source/core/data/conditio.cxx |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 7b0f65cbfa3ef0b3cb698247429f445574ba3a64
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Wed Jun 26 18:33:07 2019 +0200
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Thu Jun 27 01:39:48 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 <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 50cd4c73eba1ae2802a4897410bd3f75516d0dcb)
    Reviewed-on: https://gerrit.libreoffice.org/74764

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)


More information about the Libreoffice-commits mailing list