summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2021-11-24 21:23:51 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2021-11-25 13:34:45 +0100
commit2997c5c2604cd5054710ad35e1e0a9fd18f8ae79 (patch)
tree50bde56292babffe2017f6918f6d4704ee18858a /sc
parent9d13202243b26d507b61eb4a787d1df2ce037e21 (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 (cherry picked from commit 89c4bc5220810dc3684a473f87d001f2c55438a1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125725 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/column4.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 54213f2cd582..14781f74d22e 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -566,11 +566,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
{