From 1f7a4ef133542b19d5093fe8e02eb366a7888fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Wed, 15 Jan 2025 13:58:34 +0900 Subject: [PATCH] tdf#148812 write #NAME? for an empty definedName value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sc/source/filter/excel/xename.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 5607a9068d4f..aa33b31deeb3 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -322,6 +322,8 @@ OUString XclExpName::GetWithDefaultRangeSeparator( const OUString& rSymbol ) con } } } + if (rSymbol.isEmpty()) + return u"#NAME?"_ustr; return rSymbol; }