sc/source/core/data/documen4.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 68db5b64b8db405f9e6c0368836a8ee671b46830
Author:     Noel Grandin <[email protected]>
AuthorDate: Sat Jun 28 16:13:53 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sun Jun 29 12:57:29 2025 +0200

    crashtesting ooo120243-1.ods
    
    regression from
        commit c8742f36fa2bdc9d23042378f5b587ccda8b54dd
        Author: Noel Grandin <[email protected]>
        Date:   Thu May 22 10:18:48 2025 +0200
        tdf#166684 reduce cost of CellAttributeHelper::registerAndCheck
    
    This is strictly speaking a workaround. I have no idea how improving the 
speed of
    searching ends up triggering a re-allocation of these data-structures.
    
    Change-Id: I13ac6d85aae7c56d1adfcabf1ca73381bfb81ac4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187134
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx
index 771c4d81964a..61b9670a6f84 100644
--- a/sc/source/core/data/documen4.cxx
+++ b/sc/source/core/data/documen4.cxx
@@ -804,6 +804,11 @@ const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, 
SCROW nRow, SCTAB nTab,
         aCell.assign(const_cast<ScDocument&>(*this), aPos);
         pCell = &aCell;
     }
+    // if the underlying cell needs evaluation, ScPatternAttr
+    // and ScCondFormatIndexes might end up being deleted under
+    // us, so we need to trigger evaluation before accessing them.
+    if (pCell->getType() == CELLTYPE_FORMULA)
+        pCell->getFormula()->IsValue();
     const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab );
     const ScCondFormatIndexes& rIndex =
         pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();

Reply via email to