summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/runtime/methods1.cxx10
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--offapi/com/sun/star/i18n/LocaleCalendar.idl10
-rw-r--r--offapi/type_reference/types.rdbbin7655424 -> 7655424 bytes
-rw-r--r--sc/source/core/data/global.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx5
-rw-r--r--svl/inc/svl/ondemand.hxx12
-rw-r--r--svl/source/numbers/zforfind.cxx9
-rw-r--r--svl/source/numbers/zforlist.cxx2
-rw-r--r--svtools/source/control/calendar.cxx3
-rw-r--r--sw/inc/swcalwrp.hxx4
-rw-r--r--unotools/inc/unotools/calendarwrapper.hxx7
-rw-r--r--unotools/source/i18n/calendarwrapper.cxx9
-rw-r--r--vcl/source/control/field2.cxx5
14 files changed, 34 insertions, 46 deletions
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 7072c09cb3d7..6dae3f4bbb63 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -48,7 +48,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/i18n/XCalendar3.hpp>
+#include <com/sun/star/i18n/LocaleCalendar.hpp>
#include <com/sun/star/sheet/XFunctionAccess.hpp>
using namespace comphelper;
@@ -64,12 +64,8 @@ static Reference< XCalendar3 > getLocaleCalendar( void )
static Reference< XCalendar3 > xCalendar;
if( !xCalendar.is() )
{
- Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
- if( xSMgr.is() )
- {
- xCalendar = Reference< XCalendar3 >( xSMgr->createInstance
- ( ::rtl::OUString("com.sun.star.i18n.LocaleCalendar" ) ), UNO_QUERY );
- }
+ Reference< XComponentContext > xContext = getProcessComponentContext();
+ xCalendar = LocaleCalendar::create(xContext);
}
static com::sun::star::lang::Locale aLastLocale;
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 7de5d775a93d..b1b5e2da2a9f 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -153,6 +153,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/i18n,\
BreakIterator \
+ LocaleCalendar \
LocaleData \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/linguistic2,\
@@ -861,7 +862,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/i18n,\
Collator \
IndexEntrySupplier \
InputSequenceChecker \
- LocaleCalendar \
NativeNumberSupplier \
NumberFormatMapper \
OrdinalSuffix \
diff --git a/offapi/com/sun/star/i18n/LocaleCalendar.idl b/offapi/com/sun/star/i18n/LocaleCalendar.idl
index 8ab37fc5b315..db4c3545ae40 100644
--- a/offapi/com/sun/star/i18n/LocaleCalendar.idl
+++ b/offapi/com/sun/star/i18n/LocaleCalendar.idl
@@ -20,8 +20,6 @@
#ifndef __com_sun_star_i18n_LocaleCalendar_idl__
#define __com_sun_star_i18n_LocaleCalendar_idl__
-#include <com/sun/star/i18n/XCalendar.idl>
-#include <com/sun/star/i18n/XExtendedCalendar.idl>
#include <com/sun/star/i18n/XCalendar3.idl>
@@ -29,13 +27,7 @@ module com { module sun { module star { module i18n {
/// Access a locale specific calendar.
-published service LocaleCalendar
-{
- interface com::sun::star::i18n::XCalendar;
-
- [optional] interface com::sun::star::i18n::XExtendedCalendar;
- [optional] interface com::sun::star::i18n::XCalendar3;
-};
+published service LocaleCalendar : XCalendar3;
}; }; }; };
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index da0750a56458..8a3c658466ab 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 2cefa9468cc5..4b9eaa66c6fc 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -1137,7 +1137,7 @@ CalendarWrapper* ScGlobal::GetCalendar()
{
if ( !pCalendar )
{
- pCalendar = new CalendarWrapper( ::comphelper::getProcessServiceFactory() );
+ pCalendar = new CalendarWrapper( ::comphelper::getProcessComponentContext() );
pCalendar->loadDefaultCalendar( *GetLocale() );
}
return pCalendar;
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 05521e20ecd8..f96663069816 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -28,6 +28,7 @@
#include "sc.hrc"
+#include <comphelper/processfactory.hxx>
#include <i18npool/mslangid.hxx>
#include <sot/formats.hxx>
#include <sfx2/mieclip.hxx>
@@ -1296,7 +1297,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
::utl::TransliterationWrapper aTransliteration(
pDoc->GetServiceManager(), SC_TRANSLITERATION_IGNORECASE );
aTransliteration.loadModuleIfNeeded( eDocLang );
- CalendarWrapper aCalendar( pDoc->GetServiceManager() );
+ CalendarWrapper aCalendar( comphelper::getComponentContext(pDoc->GetServiceManager()) );
aCalendar.loadDefaultCalendar(
MsLangId::convertLanguageToLocale( eDocLang ) );
::utl::TransliterationWrapper* pEnglishTransliteration = NULL;
@@ -1306,7 +1307,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
pEnglishTransliteration = new ::utl::TransliterationWrapper (
pDoc->GetServiceManager(), SC_TRANSLITERATION_IGNORECASE );
aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US );
- pEnglishCalendar = new CalendarWrapper ( pDoc->GetServiceManager() );
+ pEnglishCalendar = new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) );
pEnglishCalendar->loadDefaultCalendar(
MsLangId::convertLanguageToLocale( LANGUAGE_ENGLISH_US ) );
}
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 );
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index c5a7514e6cf0..4cda4dbcc08f 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -35,6 +35,7 @@
#include <vcl/floatwin.hxx>
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
+#include <comphelper/processfactory.hxx>
#include <unotools/calendarwrapper.hxx>
#include <unotools/localedatawrapper.hxx>
#include <com/sun/star/i18n/Weekdays.hpp>
@@ -256,7 +257,7 @@ void Calendar::ImplInitSettings()
Calendar::Calendar( Window* pParent, WinBits nWinStyle ) :
Control( pParent, nWinStyle & (WB_TABSTOP | WB_GROUP | WB_BORDER | WB_3DLOOK | WB_RANGESELECT | WB_MULTISELECT) ),
- maCalendarWrapper( Application::GetAppLocaleDataWrapper().getServiceFactory() ),
+ maCalendarWrapper( comphelper::getComponentContext(Application::GetAppLocaleDataWrapper().getServiceFactory()) ),
maOldFormatFirstDate( 0, 0, 1900 ),
maOldFormatLastDate( 0, 0, 1900 ),
maFirstDate( 0, 0, 1900 ),
diff --git a/sw/inc/swcalwrp.hxx b/sw/inc/swcalwrp.hxx
index 31579428f88f..0d150bccdb5b 100644
--- a/sw/inc/swcalwrp.hxx
+++ b/sw/inc/swcalwrp.hxx
@@ -32,8 +32,8 @@ class SwCalendarWrapper : public CalendarWrapper
public:
SwCalendarWrapper( const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > & xMSF = ::comphelper::getProcessServiceFactory() )
- : CalendarWrapper( xMSF ), nLang( LANGUAGE_SYSTEM )
+ ::com::sun::star::uno::XComponentContext > & rxContext = ::comphelper::getProcessComponentContext() )
+ : CalendarWrapper( rxContext ), nLang( LANGUAGE_SYSTEM )
{}
void LoadDefaultCalendar( sal_uInt16 nLang );
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()
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 379aa5cb25ea..be162a457548 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -26,6 +26,9 @@
*
************************************************************************/
+#include "sal/config.h"
+
+#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <tools/rc.h>
#include <vcl/svapp.hxx>
@@ -1577,7 +1580,7 @@ CalendarWrapper& DateFormatter::GetCalendarWrapper() const
{
if ( !mpCalendarWrapper )
{
- ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( vcl::unohelper::GetMultiServiceFactory() );
+ ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getComponentContext( vcl::unohelper::GetMultiServiceFactory() ) );
mpCalendarWrapper->loadDefaultCalendar( GetLocale() );
}