diff options
-rw-r--r-- | sc/source/core/data/column.cxx | 20 |
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 ) |