sc/source/core/tool/compiler.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
New commits: commit 978acf71136df9e491c0de78423f55da49bae4fd Author: Karthik Godha <[email protected]> AuthorDate: Thu Jan 8 15:27:39 2026 +0530 Commit: Michael Stahl <[email protected]> CommitDate: Fri Jan 9 20:17:37 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]> diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 976c225ae5ef..478100909ce6 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2011,8 +2011,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()); @@ -2035,12 +2035,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 + "'";
