summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-08-15 21:23:18 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-08-16 20:01:27 +0000
commit328d0fcbe2a9dbcb3431d6142073bfe0ea6792cb (patch)
tree44f17f23a19fc8ea769723e6423c34a72f17d9ef
parentd15b7eb6b4525283343b5030b3227c264ec8976b (diff)
Resolves: tdf#100852 update miBroadcasterPos before copying it
Change-Id: I9ab9acfb0871355ceb2c3c83f51e7ba05a74d8f2 (cherry picked from commit 7b768dd9a78d2a979eb4d1b1b5b33a4f01a1a98a) Reviewed-on: https://gerrit.libreoffice.org/28151 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/core/data/column.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index fdecc5f5ab7e..bb1f56431418 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1510,7 +1510,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 )