sc/source/core/data/column2.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
New commits: commit cd90f9d0dcf0b6fc71161417deefb501929f67ce Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Dec 6 15:25:02 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Dec 6 18:05:49 2022 +0000 crashtesting forum-en-4598.ods the pattern object may be replaced inside the IsValue() call because it might trigger interpreter logic Change-Id: I99cee16333f3ab0585d94de98946ea77938e14ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143734 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 7f3a5d1e3d5d..4f5c717cec4e 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -171,7 +171,18 @@ tools::Long ScColumn::GetNeededSize( if (aCell.getType() == CELLTYPE_FORMULA) { ScFormulaCell* pFCell = aCell.getFormula(); - bCellIsValue = pFCell->IsRunning() || pFCell->IsValue(); + bCellIsValue = pFCell->IsRunning(); + if (!bCellIsValue) + { + bCellIsValue = pFCell->IsValue(); + if (bCellIsValue) + { + // the pattern may change in IsValue() + pPattern = pAttrArray->GetPattern( nRow ); + if (ppPatternChange) + *ppPatternChange = pPattern; + } + } } // #i111387#, tdf#121040: disable automatic line breaks for all number formats