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

New commits:
commit c1e73e5112dbc31a1dfa3a29e022668cd61c0592
Author:     Karthik Godha <[email protected]>
AuthorDate: Thu Jan 8 10:07:05 2026 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Jan 14 13:50:46 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]>
    (cherry picked from commit 6242665dbc9b5a444889d5bde4d50e67beb17f2f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197157

diff --git a/sc/source/filter/excel/xicontent.cxx 
b/sc/source/filter/excel/xicontent.cxx
index cd284c32ee1a..a121cb6d4f61 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -663,6 +663,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);
         }
@@ -677,6 +683,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