sc/source/core/tool/compiler.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit 822e8c118c860500211c2f97a61cc160d0550c20
Author:     Karthik Godha <[email protected]>
AuthorDate: Sat Jan 10 15:39:19 2026 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Jan 14 15:33:14 2026 +0100

    XLSX - Skip writing invalid workbook references
    
    Use "#REF!" for invalid workbook references in definedNames
    
    bug document: fdo86372-2.xls
    
    Change-Id: Ib5fa2da4dc817899e45856e3f9bafbb817463a21
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196959
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit c305f95ced45b7cbcee9e7344d4484b6433a60c5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197244

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 6c86f378805a..7845de51468c 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -1576,6 +1576,12 @@ struct ConventionXL_OOX : public ConventionXL_A1
         // Where N is a 1-based positive integer number of a file name in OOXML
         // xl/externalLinks/externalLinkN.xml
 
+        if (rTabName.isEmpty())
+        {
+            rBuffer.append(ScGlobal::GetErrorString(FormulaError::NoRef));
+            return;
+        }
+
         OUString aQuotedTab( rTabName);
         ScCompiler::CheckTabQuotes( aQuotedTab);
         if (!aQuotedTab.isEmpty() && aQuotedTab[0] == '\'')
@@ -1606,6 +1612,12 @@ struct ConventionXL_OOX : public ConventionXL_A1
         // sheet names as well. The [N] having to be within the quoted sheet
         // name is ugly enough...
 
+        if (rTabName.isEmpty())
+        {
+            rBuffer.append(ScGlobal::GetErrorString(FormulaError::NoRef));
+            return;
+        }
+
         ScRange aAbsRef = rRef.toAbs(rLimits, rPos);
 
         OUStringBuffer aBuf;

Reply via email to