From cf8cfee9d4e64dba6a14dde16f08a7699fdff863 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Sun, 1 Jan 2023 15:35:16 +0100 Subject: Resolves: tdf#151886 Use default locale with English function names again Automatically switching to en-US locale when using English function names caused too much confusion. There also might be the possibility that the '.' dot decimal separator clashes with the inline array column separator in some locales. A proper solution would make this user-specified and if set also adjust the separators to the common English ones. For now keep the default locale again as it previously was the case. Change-Id: Ic4712c6609c14f35cf0d1d842ac7443806a6e115 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144924 Reviewed-by: Eike Rathke Tested-by: Jenkins --- include/formula/FormulaCompiler.hxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'include/formula') diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx index d94dbd40d399..08710f561b5a 100644 --- a/include/formula/FormulaCompiler.hxx +++ b/include/formula/FormulaCompiler.hxx @@ -83,12 +83,13 @@ public: { OpCodeHashMap maHashMap; /// Hash map of symbols, OUString -> OpCode std::unique_ptr mpTable; /// Array of symbols, OpCode -> OUString, offset==OpCode - ExternalHashMap maExternalHashMap; /// Hash map of ocExternal, Filter String -> AddIn String - ExternalHashMap maReverseExternalHashMap; /// Hash map of ocExternal, AddIn String -> Filter String + ExternalHashMap maExternalHashMap; /// Hash map of ocExternal, Filter String -> AddIn String + ExternalHashMap maReverseExternalHashMap; /// Hash map of ocExternal, AddIn String -> Filter String FormulaGrammar::Grammar meGrammar; /// Grammar, language and reference convention sal_uInt16 mnSymbols; /// Count of OpCode symbols - bool mbCore : 1; /// If mapping was setup by core, not filters - bool mbEnglish : 1; /// If English symbols and external names + bool mbCore : 1; /// If mapping was setup by core, not filters + bool mbEnglish : 1; /// If English symbols and external names + bool mbEnglishLocale : 1; /// If English locale for numbers OpCodeMap( const OpCodeMap& ) = delete; OpCodeMap& operator=( const OpCodeMap& ) = delete; @@ -101,7 +102,8 @@ public: meGrammar( eGrammar), mnSymbols( nSymbols), mbCore( bCore), - mbEnglish ( FormulaGrammar::isEnglish(eGrammar) ) + mbEnglish ( FormulaGrammar::isEnglish(eGrammar) ), + mbEnglishLocale ( mbEnglish ) { } @@ -145,6 +147,10 @@ public: be English as well)? */ bool isEnglish() const { return mbEnglish; } + /** Are inline numbers parsed/formatted in en-US locale, as opposed + to default locale? */ + bool isEnglishLocale() const { return mbEnglishLocale; } + /// Is it an ODF 1.1 compatibility mapping? bool isPODF() const { return FormulaGrammar::isPODF( meGrammar); } -- cgit