diff options
author | Eike Rathke <erack@redhat.com> | 2021-11-24 21:23:51 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2021-11-24 22:42:05 +0100 |
commit | 89c4bc5220810dc3684a473f87d001f2c55438a1 (patch) | |
tree | 2814f7cf93b3dbead8544c692a24588072f4b51e /sc | |
parent | b6b7fb3d0a46a2d41fcd8f2319077fe280ff12f1 (diff) |
Resolves: tdf#128914 Create copies for non-shareable token arrays
Change-Id: I59fdcf48fb0da9d944b00a140e043e4ea5fb1ae5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125789
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/column4.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index 39829122c17e..fc4c3a5e38e2 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -564,11 +564,15 @@ void ScColumn::CloneFormulaCell( ScAddress aPos(nCol, nRow1, nTab); - if (nLen == 1) + if (nLen == 1 || !rSrc.GetCode()->IsShareable()) { - // Single, ungrouped formula cell. - ScFormulaCell* pCell = new ScFormulaCell(rSrc, rDocument, aPos); - aFormulas.push_back(pCell); + // Single, ungrouped formula cell, or create copies for + // non-shareable token arrays. + for (size_t i = 0; i < nLen; ++i, aPos.IncRow()) + { + ScFormulaCell* pCell = new ScFormulaCell(rSrc, rDocument, aPos); + aFormulas.push_back(pCell); + } } else { |