required/CWS internatiodel : More replacement of class International

[email protected] Wed, 21 Sep 2005 13:05:55 +0200 (CEST)
Newsgroups gmane.comp.openoffice.announce.interface
Message-ID <31545450.1127300755168.JavaMail.root@sd-web1>
Type
required

Title
More replacement of class International

Posted by
[email protected]

Affected
,unotools,vcl

Effective from
CWS internatiodel

Summary

vcl/settings.hxx:
- const International& AllSettings::GetInternational() const;

vcl/svapp.hxx:
- static const International& Application::GetAppInternational();
+ static const LocaleDataWrapper& Application::GetAppLocaleDataWrapper();

unotools/localedatawrapper.hxx:
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & getServiceFactory() > const;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::Calendar > getDefaultCalendar() const;
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > getDefaultCalendarDays() const;
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > getDefaultCalendarMonths() const;

Description

A word about

static const LocaleDataWrapper& Application::GetAppLocaleDataWrapper();
and
static const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper();

Never hold that reference in a member or static variable, the instance
may change if the configuration changes. If possible (i.e. if above
module svtools) use only class SvtSysLocale from svtools/syslocale.hxx,
which also follows the configuration but instantiation is safe
(singleton).

class LocaleDataWrapper
{
/** Get the service factory, meant to be able to create a
CalendarWrapper from a LocaleDataWrapper. Note that the service
factory may be non-existent if this LocaleDataWrapper was
created without one and lives "on the grassland". The
CalendarWrapper ctor can handle that though. */
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory > &
getServiceFactory() const;

/// Convenience method to obtain the default calendar.
const ::com::sun::star::uno::Reference<
::com::sun::star::i18n::Calendar > getDefaultCalendar() const;

/// Convenience method to obtain the day names of the default
calendar.
const ::com::sun::star::uno::Sequence<
::com::sun::star::i18n::CalendarItem >
getDefaultCalendarDays() const;

/// Convenience method to obtain the month names of the default
calendar.
const ::com::sun::star::uno::Sequence<
::com::sun::star::i18n::CalendarItem >
getDefaultCalendarMonths() const;
};

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]