sc/source/core/tool/compiler.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
New commits: commit 0e12a541442c07ef91b9f09f1a84a45425bb09da Author: Karthik Godha <[email protected]> AuthorDate: Thu Jan 8 15:27:39 2026 +0530 Commit: Michael Stahl <[email protected]> CommitDate: Thu Jan 15 16:47:43 2026 +0100 XLS->XLSX: Quote sheet names starting with numbers In 'definedNames' element enclose sheet names starting with numbers in quotes, this is what Microsoft Excel expects. bug document: fdo54055-1.xlsx Change-Id: I5e729defa4c75aba71b629fffbef05d0b710b76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196832 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit 978acf71136df9e491c0de78423f55da49bae4fd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197080 (cherry picked from commit 7a207d9974846b894eac2380042013f771abc8ba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197327 Tested-by: Michael Stahl <[email protected]> diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 0ff3960bdee7..c5d53586080f 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1968,8 +1968,8 @@ ScCompiler::~ScCompiler() void ScCompiler::CheckTabQuotes( OUString& rString, const FormulaGrammar::AddressConvention eConv ) { - sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER | KParseTokens::ASC_UNDERSCORE; - sal_Int32 nContFlags = nStartFlags; + sal_Int32 nStartFlags = KParseTokens::ANY_LETTER | KParseTokens::ASC_UNDERSCORE; + sal_Int32 nContFlags = nStartFlags | KParseTokens::ANY_NUMBER; ParseResult aRes = ScGlobal::getCharClass().parsePredefinedToken( KParseType::IDENTNAME, rString, 0, nStartFlags, OUString(), nContFlags, OUString()); bool bNeedsQuote = !((aRes.TokenType & KParseType::IDENTNAME) && aRes.EndPos == rString.getLength()); @@ -1992,12 +1992,6 @@ void ScCompiler::CheckTabQuotes( OUString& rString, break; } - if ( !bNeedsQuote && CharClass::isAsciiNumeric( rString ) ) - { - // Prevent any possible confusion resulting from pure numeric sheet names. - bNeedsQuote = true; - } - if( bNeedsQuote ) { rString = "'" + rString + "'";
