sc/source/filter/excel/xicontent.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 6242665dbc9b5a444889d5bde4d50e67beb17f2f
Author:     Karthik Godha <[email protected]>
AuthorDate: Thu Jan 8 10:07:05 2026 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Thu Jan 8 17:55:10 2026 +0100

    tdf#170263: Skip external formulas in Conditional Formatting
    
    During XLS import skip import of external formulas in Conditional
    Formatting. Microsoft Excel does the same.
    
    Change-Id: I4b6512b77c19907d69659fc4c057ef4b3355b1d3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196791
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sc/source/filter/excel/xicontent.cxx 
b/sc/source/filter/excel/xicontent.cxx
index 6bad00d2bc8e..23abae2e3516 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -662,6 +662,12 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
         // formula converter owns pTokArr -> create a copy of the token array
         if( pTokArr )
         {
+            // If it's an external formula then skip the entry
+            if (const formula::FormulaToken* pToken = pTokArr->FirstToken())
+            {
+                if (pToken->GetOpCode() == ocExternal)
+                    return;
+            }
             xTokArr1 = std::move( pTokArr );
             GetDoc().CheckLinkFormulaNeedingCheck( *xTokArr1);
         }
@@ -676,6 +682,12 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
         // formula converter owns pTokArr -> create a copy of the token array
         if( pTokArr )
         {
+            // If it's an external formula then skip the entry
+            if (const formula::FormulaToken* pToken = pTokArr->FirstToken())
+            {
+                if (pToken->GetOpCode() == ocExternal)
+                    return;
+            }
             xTokArr2 = std::move( pTokArr );
             GetDoc().CheckLinkFormulaNeedingCheck( *xTokArr2);
         }

Reply via email to