diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-25 17:18:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-29 17:32:57 +0100 |
commit | 8fff6bf6bdab6b7addcbbf472a226706edda1edb (patch) | |
tree | a27347a5b8e0bef5c00757a56a0e9a217fcb2f59 /svl | |
parent | d29818290376f10f318ba805a79643384b34986e (diff) |
fdo#46808, Adapt i18n::LocaleCalendar UNO service to new style
Did not need to create a new interface, because XCalendar3
already covers the whole service interface.
Change-Id: Iaf094014c16e872d2003ca6e8e7588abd081d882
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/ondemand.hxx | 12 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 9 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 2 |
3 files changed, 11 insertions, 12 deletions
diff --git a/svl/inc/svl/ondemand.hxx b/svl/inc/svl/ondemand.hxx index d90314db286f..47488504b073 100644 --- a/svl/inc/svl/ondemand.hxx +++ b/svl/inc/svl/ondemand.hxx @@ -165,7 +165,7 @@ public: */ class OnDemandCalendarWrapper { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::lang::Locale aLocale; mutable CalendarWrapper* pPtr; mutable bool bValid; @@ -178,13 +178,13 @@ public: , bInitialized(false) {} OnDemandCalendarWrapper( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, ::com::sun::star::lang::Locale& rLocale ) : bValid(false) , bInitialized(false) { - init( rxSMgr, rLocale ); + init( rxContext, rLocale ); } ~OnDemandCalendarWrapper() { @@ -196,11 +196,11 @@ public: bool is() const { return pPtr != NULL; } void init( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, ::com::sun::star::lang::Locale& rLocale ) { - xSMgr = rxSMgr; + m_xContext = rxContext; changeLocale( rLocale ); if ( pPtr ) { @@ -221,7 +221,7 @@ public: if ( !bValid ) { if ( !pPtr ) - pPtr = new CalendarWrapper( xSMgr ); + pPtr = new CalendarWrapper( m_xContext ); pPtr->loadDefaultCalendar( aLocale ); bValid = true; } diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index da2a66f90311..55d7fd76c54e 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -30,6 +30,7 @@ #include <unotools/calendarwrapper.hxx> #include <unotools/localedatawrapper.hxx> #include <com/sun/star/i18n/CalendarFieldIndex.hpp> +#include <com/sun/star/i18n/LocaleCalendar.hpp> #include <unotools/digitgroupingiterator.hxx> #include <svl/zforlist.hxx> // NUMBERFORMAT_XXX @@ -1766,11 +1767,9 @@ input for the following reasons: sal_Int16 nDaySet, nMonthSet, nYearSet, nHourSet, nMinuteSet, nSecondSet; sal_Int16 nZO, nDST1, nDST2, nDST, nZOmillis, nDST1millis, nDST2millis, nDSTmillis; sal_Int32 nZoneInMillis, nDST1InMillis, nDST2InMillis; - uno::Reference< lang::XMultiServiceFactory > xSMgr = - ::comphelper::getProcessServiceFactory(); - uno::Reference< ::com::sun::star::i18n::XCalendar3 > xCal( - xSMgr->createInstance( "com.sun.star.i18n.LocaleCalendar" ), - uno::UNO_QUERY ); + uno::Reference< uno::XComponentContext > xContext = + ::comphelper::getProcessComponentContext(); + uno::Reference< i18n::XCalendar3 > xCal = i18n::LocaleCalendar::create(xContext); for ( const entry* p = cals; p->lan; ++p ) { aLocale.Language = ::rtl::OUString::createFromAscii( p->lan ); diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 9bc4f5d4bfeb..9919cf9d0ad6 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -236,7 +236,7 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang ) aLocale = MsLangId::convertLanguageToLocale( eLang ); pCharClass = new CharClass( xServiceManager, aLocale ); xLocaleData.init( xServiceManager, aLocale, eLang ); - xCalendar.init( xServiceManager, aLocale ); + xCalendar.init( comphelper::getComponentContext(xServiceManager), aLocale ); xTransliteration.init( xServiceManager, eLang, ::com::sun::star::i18n::TransliterationModules_IGNORE_CASE ); xNatNum.init( xServiceManager ); |