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/characterclassification | |
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/characterclassification')
-rw-r--r-- | i18npool/source/characterclassification/cclass_unicode_parser.cxx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/i18npool/source/characterclassification/cclass_unicode_parser.cxx b/i18npool/source/characterclassification/cclass_unicode_parser.cxx index 5de6eaaba658..f538933c6207 100644 --- a/i18npool/source/characterclassification/cclass_unicode_parser.cxx +++ b/i18npool/source/characterclassification/cclass_unicode_parser.cxx @@ -25,8 +25,9 @@ #include <com/sun/star/i18n/KParseTokens.hpp> #include <com/sun/star/i18n/KParseType.hpp> #include <com/sun/star/i18n/UnicodeType.hpp> -#include <com/sun/star/i18n/XLocaleData.hpp> +#include <com/sun/star/i18n/LocaleData.hpp> #include <com/sun/star/i18n/NativeNumberMode.hpp> +#include <comphelper/componentcontext.hxx> #include <string.h> // memcpy() @@ -398,17 +399,9 @@ sal_Bool cclass_Unicode::setupInternational( const Locale& rLocale ) aParserLocale.Country = rLocale.Country; aParserLocale.Variant = rLocale.Variant; } - if ( !xLocaleData.is() && xMSF.is() ) + if ( !mxLocaleData.is() ) { - Reference < - XInterface > xI = - xMSF->createInstance( OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.LocaleData" ) ) ); - if ( xI.is() ) - { - Any x = xI->queryInterface( getCppuType((const Reference< XLocaleData>*)0) ); - x >>= xLocaleData; - } + mxLocaleData.set( LocaleData::create(comphelper::ComponentContext(xMSF).getUNOContext()) ); } return bChanged; } @@ -458,10 +451,10 @@ void cclass_Unicode::initParserTable( const Locale& rLocale, sal_Int32 startChar aContChars = userDefinedCharactersCont; // specials - if( xLocaleData.is() ) + if( mxLocaleData.is() ) { LocaleDataItem aItem = - xLocaleData->getLocaleItem( aParserLocale ); + mxLocaleData->getLocaleItem( aParserLocale ); //!TODO: theoretically separators may be a string, adjustment would have to be //! done here and in parsing and in ::rtl::math::stringToDouble() cGroupSep = aItem.thousandSeparator.getStr()[0]; |