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 /unotools | |
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 'unotools')
-rw-r--r-- | unotools/inc/unotools/calendarwrapper.hxx | 7 | ||||
-rw-r--r-- | unotools/source/i18n/calendarwrapper.cxx | 9 |
2 files changed, 6 insertions, 10 deletions
diff --git a/unotools/inc/unotools/calendarwrapper.hxx b/unotools/inc/unotools/calendarwrapper.hxx index 96de48d29434..d7e66dea0f33 100644 --- a/unotools/inc/unotools/calendarwrapper.hxx +++ b/unotools/inc/unotools/calendarwrapper.hxx @@ -29,8 +29,8 @@ #include "unotools/unotoolsdllapi.h" namespace com { namespace sun { namespace star { - namespace lang { - class XMultiServiceFactory; + namespace uno { + class XComponentContext; } }}} @@ -43,14 +43,13 @@ namespace com { namespace sun { namespace star { class UNOTOOLS_DLLPUBLIC CalendarWrapper { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr; ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCalendar3 > xC; DateTime aEpochStart; // 1Jan1970 public: CalendarWrapper( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext ); ~CalendarWrapper(); diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx index bc16c118e088..857065221008 100644 --- a/unotools/source/i18n/calendarwrapper.cxx +++ b/unotools/source/i18n/calendarwrapper.cxx @@ -24,9 +24,7 @@ #include <unotools/calendarwrapper.hxx> #include <instance.hxx> #include <com/sun/star/i18n/CalendarFieldIndex.hpp> -#include <com/sun/star/i18n/XCalendar3.hpp> - -#define CALENDAR_SERVICENAME "com.sun.star.i18n.LocaleCalendar" +#include <com/sun/star/i18n/LocaleCalendar.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::i18n; @@ -37,13 +35,12 @@ const double MILLISECONDS_PER_DAY = 1000.0 * 60.0 * 60.0 * 24.0; CalendarWrapper::CalendarWrapper( - const Reference< lang::XMultiServiceFactory > & xSF + const Reference< uno::XComponentContext > & rxContext ) : - xSMgr( xSF ), aEpochStart( Date( 1, 1, 1970 ) ) { - xC = Reference< XCalendar3 >( intl_createInstance( xSMgr, CALENDAR_SERVICENAME, "CalendarWrapper" ), uno::UNO_QUERY ); + xC = LocaleCalendar::create(rxContext); } CalendarWrapper::~CalendarWrapper() |