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

New commits:
commit c1cf7ae8a734f26aee6fa38a08e53217f3ab88dd
Author:     Tomaž Vajngerl <[email protected]>
AuthorDate: Wed Jan 15 13:58:34 2025 +0900
Commit:     Andras Timar <[email protected]>
CommitDate: Fri Jan 17 13:28:03 2025 +0100

    tdf#148812 write #NAME? for an empty definedName value
    
    This keeps MSOffice silent when opening the documents that don't
    have the any range/formula expression set for the define name.
    
    Change-Id: Ib4cc01a5c51b3875c0d8e0870e2bdf9c15794df1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180258
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    (cherry picked from commit 1f7a4ef133542b19d5093fe8e02eb366a7888fd7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180370
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>

diff --git a/sc/source/filter/excel/xename.cxx 
b/sc/source/filter/excel/xename.cxx
index 84073da8ff90..d0e6a7bc92c2 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -321,6 +321,8 @@ OUString XclExpName::GetWithDefaultRangeSeparator( const 
OUString& rSymbol ) con
             }
         }
     }
+    if (rSymbol.isEmpty())
+        return u"#NAME?"_ustr;
     return rSymbol;
 }
 

Reply via email to