From ddac824d9c109430f5caad05ca1d84cfcd599c4f Mon Sep 17 00:00:00 2001 From: Winfried Donkers Date: Wed, 25 Sep 2013 07:41:34 +0200 Subject: fdo#50118 use English add-in function names This patch sets the function names of add-in functions as set in the golbal configuration of LibreOffice ('Use English Function names') Changing this setting has not yet an immediate effect. (I'm still working on that, which is a hard nut to crack.) The add-in function names are set at start up of calc. Change-Id: I5fffd9edb09647c1bcd0c3f35ffa6ab69ef48589 Reviewed-on: https://gerrit.libreoffice.org/6032 Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- sc/source/core/tool/addincol.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'sc') diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 807bba24a73d..db0d521cc731 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -50,6 +50,7 @@ #include "rangeseq.hxx" #include "funcdesc.hxx" #include "svl/sharedstring.hxx" +#include "formulaopt.hxx" //fdo50118 using namespace com::sun::star; @@ -746,12 +747,15 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference& uno::Reference xName( xInterface, uno::UNO_QUERY ); if ( xAddIn.is() && xName.is() ) { - // AddIns must use the language for which the office is installed - lang::Locale aLocale( Application::GetSettings().GetUILanguageTag().getLocale()); - xAddIn->setLocale( aLocale ); + // fdo50118 when GetUseEnglishFunctionName() returns true, set the + // locale to en-US to get English function names + if ( SC_MOD()->GetFormulaOptions().GetUseEnglishFuncName() ) + xAddIn->setLocale( lang::Locale( "en", "US", "")); + else + xAddIn->setLocale( Application::GetSettings().GetUILanguageTag().getLocale()); OUString aServiceName( xName->getServiceName() ); - ScUnoAddInHelpIdGenerator aHelpIdGenerator( xName->getServiceName() ); + ScUnoAddInHelpIdGenerator aHelpIdGenerator( aServiceName ); //! pass XIntrospection to ReadFromAddIn @@ -1001,8 +1005,12 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference xLoc( xInterface, uno::UNO_QUERY ); if ( xLoc.is() ) // optional in new add-ins { - lang::Locale aLocale( Application::GetSettings().GetUILanguageTag().getLocale()); - xLoc->setLocale( aLocale ); + // fdo50118 when GetUseEnglishFunctionName() returns true, set the + // locale to en-US to get English function names + if ( SC_MOD()->GetFormulaOptions().GetUseEnglishFuncName() ) + xLoc->setLocale( lang::Locale( "en", "US", "")); + else + xLoc->setLocale( Application::GetSettings().GetUILanguageTag().getLocale()); } // if function list was already initialized, it must be updated -- cgit