sc/source/filter/oox/numberformatsbuffer.cxx | 32 +++++---------------------- 1 file changed, 7 insertions(+), 25 deletions(-)
New commits: commit 88f16eb151e37a8e1cc8708f75a772e3081e0ead Author: Miklos Vajna <vmik...@suse.cz> Date: Thu Jul 12 18:36:08 2012 +0200 NumberFormatsBuffer: use new configmgr api Change-Id: I74931a6dfe08d443125956d0a93f48f7d2886601 diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx index 5133a91..83755ec 100644 --- a/sc/source/filter/oox/numberformatsbuffer.cxx +++ b/sc/source/filter/oox/numberformatsbuffer.cxx @@ -34,6 +34,8 @@ #include <com/sun/star/util/XNumberFormatTypes.hpp> #include <com/sun/star/util/XNumberFormats.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <officecfg/Setup.hxx> +#include <officecfg/System.hxx> #include <rtl/strbuf.hxx> #include <rtl/string.hxx> #include <osl/thread.h> @@ -1963,31 +1965,11 @@ NumberFormatsBuffer::NumberFormatsBuffer( const WorkbookHelper& rHelper ) : mnNextBiffIndex( 0 ) { // get the current locale - try - { - Reference< XMultiServiceFactory > xConfigProv( getBaseFilter().getServiceFactory()->createInstance( - CREATE_OUSTRING( "com.sun.star.configuration.ConfigurationProvider" ) ), UNO_QUERY_THROW ); - - // try user-defined locale setting - Sequence< Any > aArgs( 1 ); - aArgs[ 0 ] <<= CREATE_OUSTRING( "org.openoffice.Setup/L10N/" ); - Reference< XNameAccess > xConfigNA( xConfigProv->createInstanceWithArguments( - CREATE_OUSTRING( "com.sun.star.configuration.ConfigurationAccess" ), aArgs ), UNO_QUERY_THROW ); - xConfigNA->getByName( CREATE_OUSTRING( "ooSetupSystemLocale" ) ) >>= maLocaleStr; - - // if set to "use system", get locale from system - if( maLocaleStr.isEmpty() ) - { - aArgs[ 0 ] <<= CREATE_OUSTRING( "org.openoffice.System/L10N/" ); - xConfigNA.set( xConfigProv->createInstanceWithArguments( - CREATE_OUSTRING( "com.sun.star.configuration.ConfigurationAccess" ), aArgs ), UNO_QUERY_THROW ); - xConfigNA->getByName( CREATE_OUSTRING( "Locale" ) ) >>= maLocaleStr; - } - } - catch( Exception& ) - { - OSL_FAIL( "NumberFormatsBuffer::NumberFormatsBuffer - cannot get system locale" ); - } + // try user-defined locale setting + maLocaleStr = officecfg::Setup::L10N::ooSetupSystemLocale::get(); + // if set to "use system", get locale from system + if( maLocaleStr.isEmpty() ) + maLocaleStr = officecfg::System::L10N::Locale::get(); // create built-in formats for current locale insertBuiltinFormats(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits