diff options
author | Noel Grandin <noel@peralex.com> | 2012-09-13 12:47:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-17 14:28:21 +0200 |
commit | 369e3fdcdafdb112a6963fb86fa4d4d0edb29c00 (patch) | |
tree | 9b7b52b0524feee2c6cfcaf5e5fb440816520fde /i18npool/source/numberformatcode | |
parent | 9486e6c45f5e15e07f4717fdbaaf30afe6ed86b9 (diff) |
fdo#46808, Adapt i18n::LocaleData UNO service to new style
The implementation of the LocaleData implements the optional XLocaleData4,
so rather than creating a new interface for the new-style service, we simply
make the service implement XLocaleData4, which in turn implements
XLocaleData3, XLocaleData2, XLocaleData.
Change-Id: I3e9a48b031be6b2aa5e04b376b3940b942add85a
Diffstat (limited to 'i18npool/source/numberformatcode')
-rw-r--r-- | i18npool/source/numberformatcode/numberformatcode.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/i18npool/source/numberformatcode/numberformatcode.cxx b/i18npool/source/numberformatcode/numberformatcode.cxx index 96b837725f67..6ec23799719a 100644 --- a/i18npool/source/numberformatcode/numberformatcode.cxx +++ b/i18npool/source/numberformatcode/numberformatcode.cxx @@ -21,14 +21,16 @@ #include <numberformatcode.hxx> #include <com/sun/star/i18n/KNumberFormatUsage.hpp> #include <com/sun/star/i18n/KNumberFormatType.hpp> +#include <com/sun/star/i18n/LocaleData.hpp> +#include <comphelper/componentcontext.hxx> NumberFormatCodeMapper::NumberFormatCodeMapper( const ::com::sun::star::uno::Reference < - ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ) + ::com::sun::star::uno::XComponentContext >& rxContext ) : - xMSF( rxMSF ), + mxContext( rxContext ), bFormatsValid( sal_False ) { } @@ -164,10 +166,10 @@ void NumberFormatCodeMapper::getFormats( const ::com::sun::star::lang::Locale& r if ( !bFormatsValid ) { createLocaleDataObject(); - if( !xlocaleData.is() ) + if( !mxLocaleData.is() ) aFormatSeq = ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::FormatElement > (0); else - aFormatSeq = xlocaleData->getAllFormats( aLocale ); + aFormatSeq = mxLocaleData->getAllFormats( aLocale ); bFormatsValid = sal_True; } } @@ -255,17 +257,10 @@ NumberFormatCodeMapper::mapElementUsageStringToShort(const ::rtl::OUString& form void NumberFormatCodeMapper::createLocaleDataObject() { - if(xlocaleData.is()) + if(mxLocaleData.is()) return; - ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface > - xI = xMSF->createInstance( - ::rtl::OUString( "com.sun.star.i18n.LocaleData" )); - - if ( xI.is() ) { - ::com::sun::star::uno::Any x = xI->queryInterface( ::getCppuType((const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData >*)0) ); - x >>= xlocaleData; - } + mxLocaleData.set( com::sun::star::i18n::LocaleData::create(mxContext) ); } ::rtl::OUString SAL_CALL |