formula/inc/core_resource.hrc               |    1 +
 formula/source/core/api/FormulaCompiler.cxx |    4 ++++
 2 files changed, 5 insertions(+)

New commits:
commit c8a50ea1257d9550979cab05fbd34c16e206b2d8
Author:     Karthik Godha <[email protected]>
AuthorDate: Sun Feb 8 16:15:06 2026 +0530
Commit:     Karthik Godha <[email protected]>
CommitDate: Fri Feb 27 02:53:07 2026 +0100

    XLSX: "#Name!" is being exported in formulas
    
    ocNoName token of type `svExternal` or `svString` would result in
    "#name!{token_string}". In XLSX a valid formula can't contain "#name!".
    
    bug-document: forum-mso-en4-29202.xls
    Change-Id: I9dcc25f2b14948385573657c562768ff3d598d97
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198941
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit a8f540c06a0572560aa75427a1884d8ecf1a1f44)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200492
    Reviewed-by: Karthik Godha <[email protected]>
    Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 41d2efc47035..007d49d519c6 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2641,6 +2641,10 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
         else
             rBuffer.append(mxSymbols->getSymbol(eOp));
     }
+    else if (eOp == ocNoName && FormulaGrammar::isOOXML(meGrammar))
+    {
+        // Don't export "#name!" in OOXML
+    }
     else if( static_cast<sal_uInt16>(eOp) < mxSymbols->getSymbolCount())       
 // Keyword:
         rBuffer.append( mxSymbols->getSymbol( eOp));
     else
commit aaa451ad6511c2af6fb6241761261c6e9948c9fe
Author:     Karthik Godha <[email protected]>
AuthorDate: Mon Feb 9 18:03:40 2026 +0530
Commit:     Karthik Godha <[email protected]>
CommitDate: Fri Feb 27 02:52:53 2026 +0100

    XLSX: Use "#REF!" for invalid arguments in functions
    
    When importing from an XLS file, invalid function arguments can be
    imported as `ocStop` token. During XLSX export this token is not handled.
    
    bug-document: forum-mso-en4-274422.xls
    Change-Id: I88e50b3da1bda18da37640594a8c59fd5ee20c30
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198980
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit 03ec841be2e25e4497c9ee301427f5573b734c9b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200491
    Reviewed-by: Karthik Godha <[email protected]>
    Tested-by: Jenkins

diff --git a/formula/inc/core_resource.hrc b/formula/inc/core_resource.hrc
index 9deadc5a2d90..cb2359afc069 100644
--- a/formula/inc/core_resource.hrc
+++ b/formula/inc/core_resource.hrc
@@ -963,6 +963,7 @@ const std::pair<const char *, int> 
RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML[] =
     { "_xlfn.ORG.LIBREOFFICE.RAND.NV" , SC_OPCODE_RANDOM_NV },
     { "_xlfn.ORG.LIBREOFFICE.RANDBETWEEN.NV" , SC_OPCODE_RANDBETWEEN_NV },
     { "_xlfn.RANDARRAY" , SC_OPCODE_RANDARRAY },
+    { "#REF!", SC_OPCODE_STOP },
     { nullptr,  -1 }
 };
 

Reply via email to