sc/source/core/data/column.cxx |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

New commits:
commit 7b768dd9a78d2a979eb4d1b1b5b33a4f01a1a98a
Author: Eike Rathke <er...@redhat.com>
Date:   Mon Aug 15 21:23:18 2016 +0200

    Resolves: tdf#100852 update miBroadcasterPos before copying it
    
    Change-Id: I9ab9acfb0871355ceb2c3c83f51e7ba05a74d8f2

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 183327a..4257ea1 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1511,7 +1511,27 @@ public:
     ~CopyByCloneHandler()
     {
         if (mpDestPos)
+        {
+            // If broadcasters were setup in the same column,
+            // maDestPos.miBroadcasterPos doesn't match
+            // mrDestCol.maBroadcasters because it is never passed anywhere.
+            // Assign a corresponding iterator before copying all over.
+            // Otherwise this may result in wrongly copying a singular
+            // iterator.
+
+            {
+                /* XXX Using a temporary ColumnBlockPosition just for
+                 * initializing from ScColumn::maBroadcasters.begin() is ugly,
+                 * on the other hand we don't want to expose
+                 * ScColumn::maBroadcasters to the outer world and have a
+                 * getter. */
+                sc::ColumnBlockPosition aTempBlock;
+                mrDestCol.InitBlockPosition(aTempBlock);
+                maDestPos.miBroadcasterPos = aTempBlock.miBroadcasterPos;
+            }
+
             *mpDestPos = maDestPos;
+        }
     }
 
     void setStartListening( bool b )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to