From 02ea0d7bdd0192fe9349f849926efc7c922b13d4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 15 Sep 2010 21:20:46 +0200 Subject: calc-formula-variable-separators-sc.diff: formula separators changeable n#447164, i#92056 Make the formula separators changeable per locale setting, and add new configuration page for formula syntax and separators. --- formula/inc/formula/FormulaCompiler.hxx | 2 ++ formula/source/core/api/FormulaCompiler.cxx | 11 +++++++++++ 2 files changed, 13 insertions(+) (limited to 'formula') diff --git a/formula/inc/formula/FormulaCompiler.hxx b/formula/inc/formula/FormulaCompiler.hxx index b67d78abd1..d82e2c83bb 100644 --- a/formula/inc/formula/FormulaCompiler.hxx +++ b/formula/inc/formula/FormulaCompiler.hxx @@ -242,6 +242,8 @@ public: including an address reference convention. */ inline FormulaGrammar::Grammar GetGrammar() const { return meGrammar; } + static void UpdateSeparatorsNative( const rtl::OUString& rSep, const rtl::OUString& rArrayColSep, const rtl::OUString& rArrayRowSep ); + protected: virtual String FindAddInFunction( const String& rUpperName, BOOL bLocalFirst ) const; virtual void fillFromAddInCollectionUpperName( NonConstOpCodeMapPtr xMap ) const; diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 51e2ca99f1..508d780d3a 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -1678,6 +1678,17 @@ void FormulaCompiler::AppendString( rtl::OUStringBuffer& rBuffer, const String & rBuffer.append(sal_Unicode('"')); } } + +void FormulaCompiler::UpdateSeparatorsNative( + const rtl::OUString& rSep, const rtl::OUString& rArrayColSep, const rtl::OUString& rArrayRowSep ) +{ + NonConstOpCodeMapPtr xSymbolsNative; + lcl_fillNativeSymbols(xSymbolsNative); + xSymbolsNative->putOpCode(rSep, ocSep); + xSymbolsNative->putOpCode(rArrayColSep, ocArrayColSep); + xSymbolsNative->putOpCode(rArrayRowSep, ocArrayRowSep); +} + // ----------------------------------------------------------------------------- OpCode FormulaCompiler::NextToken() { -- cgit v1.2.3