LibreOffice Module svl (master) 1
Public Member Functions | Private Attributes | List of all members
OnDemandCalendarWrapper Class Reference

Load a calendar only if it's needed. More...

#include <ondemand.hxx>

Public Member Functions

 OnDemandCalendarWrapper ()
 
void init (const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::lang::Locale &rLocale)
 
void changeLocale (const css::lang::Locale &rLocale)
 
CalendarWrapperget () const
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::lang::Locale aEnglishLocale
 
css::lang::Locale aLocale
 
css::lang::Locale aLastAnyLocale
 
std::optional< CalendarWrappermoEnglish
 
std::optional< CalendarWrappermoAny
 

Detailed Description

Load a calendar only if it's needed.

Keep calendar for "en-US" locale separately, as there can be alternation between locale dependent and locale independent formats. SvNumberformatter uses it upon switching locales.

@ATTENTION If the default ctor is used the init() method MUST be called before accessing the calendar.

Definition at line 139 of file ondemand.hxx.

Constructor & Destructor Documentation

◆ OnDemandCalendarWrapper()

OnDemandCalendarWrapper::OnDemandCalendarWrapper ( )
inline

Member Function Documentation

◆ changeLocale()

void OnDemandCalendarWrapper::changeLocale ( const css::lang::Locale &  rLocale)
inline

Definition at line 165 of file ondemand.hxx.

References aLocale.

Referenced by SvNumberFormatter::ChangeIntl(), and init().

◆ get()

CalendarWrapper * OnDemandCalendarWrapper::get ( ) const
inline

Definition at line 167 of file ondemand.hxx.

References aEnglishLocale, aLastAnyLocale, aLocale, m_xContext, moAny, and moEnglish.

Referenced by SvNumberFormatter::GetCalendar().

◆ init()

void OnDemandCalendarWrapper::init ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
const css::lang::Locale &  rLocale 
)
inline

Definition at line 156 of file ondemand.hxx.

References changeLocale(), m_xContext, moAny, and moEnglish.

Referenced by SvNumberFormatter::ImpConstruct().

Member Data Documentation

◆ aEnglishLocale

css::lang::Locale OnDemandCalendarWrapper::aEnglishLocale
private

Definition at line 142 of file ondemand.hxx.

Referenced by get(), and OnDemandCalendarWrapper().

◆ aLastAnyLocale

css::lang::Locale OnDemandCalendarWrapper::aLastAnyLocale
mutableprivate

Definition at line 144 of file ondemand.hxx.

Referenced by get(), and OnDemandCalendarWrapper().

◆ aLocale

css::lang::Locale OnDemandCalendarWrapper::aLocale
private

Definition at line 143 of file ondemand.hxx.

Referenced by changeLocale(), and get().

◆ m_xContext

css::uno::Reference<css::uno::XComponentContext> OnDemandCalendarWrapper::m_xContext
private

Definition at line 141 of file ondemand.hxx.

Referenced by get(), and init().

◆ moAny

std::optional<CalendarWrapper> OnDemandCalendarWrapper::moAny
mutableprivate

Definition at line 146 of file ondemand.hxx.

Referenced by get(), and init().

◆ moEnglish

std::optional<CalendarWrapper> OnDemandCalendarWrapper::moEnglish
mutableprivate

Definition at line 145 of file ondemand.hxx.

Referenced by get(), and init().


The documentation for this class was generated from the following file: