diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-04 20:29:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-05 10:43:00 +0100 |
commit | 3d3cb7808b4ca2ce10b16644846e6709d98e593c (patch) | |
tree | 039b434801de5ab90f3bca0855fac39ee06e6564 /vcl | |
parent | 0c47fc7c0520b1a012443283c2662391090b8e95 (diff) |
turn DateFormatter::ImplInit into initializer list
Change-Id: If58b8f5c65f7d920dd3a186cf648db605799b790
Reviewed-on: https://gerrit.libreoffice.org/84464
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/field2.cxx | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 7652af9dd165..3b4c51ce0832 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -1397,23 +1397,17 @@ void DateField::ImplDateSpinArea( bool bUp ) } } -void DateFormatter::ImplInit() -{ - mbLongFormat = false; - mbShowDateCentury = true; - mpCalendarWrapper = nullptr; - mnExtDateFormat = ExtDateFieldFormat::SystemShort; -} - -DateFormatter::DateFormatter(Edit* pEdit) : - FormatterBase(pEdit), - maFieldDate( 0 ), - maLastDate( 0 ), - maMin( 1, 1, 1900 ), - maMax( 31, 12, 2200 ), - mbEnforceValidValue( true ) +DateFormatter::DateFormatter(Edit* pEdit) + : FormatterBase(pEdit) + , maFieldDate(0) + , maLastDate(0) + , maMin(1, 1, 1900) + , maMax(31, 12, 2200) + , mbLongFormat(false) + , mbShowDateCentury(true) + , mnExtDateFormat(ExtDateFieldFormat::SystemShort) + , mbEnforceValidValue(true) { - ImplInit(); } DateFormatter::~DateFormatter() @@ -1422,13 +1416,13 @@ DateFormatter::~DateFormatter() CalendarWrapper& DateFormatter::GetCalendarWrapper() const { - if ( !mpCalendarWrapper ) + if (!mxCalendarWrapper) { - const_cast<DateFormatter*>(this)->mpCalendarWrapper.reset( new CalendarWrapper( comphelper::getProcessComponentContext() ) ); - mpCalendarWrapper->loadDefaultCalendar( GetLocale() ); + const_cast<DateFormatter*>(this)->mxCalendarWrapper.reset( new CalendarWrapper( comphelper::getProcessComponentContext() ) ); + mxCalendarWrapper->loadDefaultCalendar( GetLocale() ); } - return *mpCalendarWrapper; + return *mxCalendarWrapper; } void DateFormatter::SetExtDateFormat( ExtDateFieldFormat eFormat ) |