include/vcl/field.hxx | 22 +++----- include/vcl/longcurr.hxx | 2 vcl/source/control/field.cxx | 106 +++++++++++++++++----------------------- vcl/source/control/field2.cxx | 60 +++++++++++----------- vcl/source/control/longcurr.cxx | 15 +++-- 5 files changed, 95 insertions(+), 110 deletions(-)
New commits: commit 68d370ddf14455a31898b5e456ab2b4d64ae9e51 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Nov 7 21:22:43 2018 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Nov 8 10:00:57 2018 +0100 clarify that edit doesn't change during FormatterBase lifetime Change-Id: I416eee47eaae49a629fb0199e6b086215d315a94 Reviewed-on: https://gerrit.libreoffice.org/63048 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index faf37bb2cd58..33c7ecf4e000 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -55,11 +55,11 @@ protected: SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const; - void SetField( Edit* pField ) { mpField = pField; } Edit* GetField() const { return mpField; } + void ClearField() { mpField.clear(); } public: - explicit FormatterBase(); + explicit FormatterBase(Edit* pField); virtual ~FormatterBase(); const LocaleDataWrapper& GetLocaleDataWrapper() const; @@ -95,7 +95,7 @@ private: bool mbInPattKeyInput; protected: - PatternFormatter(); + PatternFormatter(Edit* pEdit); SAL_DLLPRIVATE void ImplSetMask(const OString& rEditMask, const OUString& rLiteralMask); @@ -174,7 +174,7 @@ protected: sal_Int64 mnFirst; sal_Int64 mnLast; - NumericFormatter(); + NumericFormatter(Edit* pEdit); void FieldUp(); void FieldDown(); @@ -244,7 +244,7 @@ protected: FieldUnit meUnit; Link<MetricFormatter&,void> maCustomConvertLink; - MetricFormatter(); + MetricFormatter(Edit* pEdit); SAL_DLLPRIVATE void ImplMetricReformat( const OUString& rStr, double& rValue, OUString& rOutStr ); @@ -262,7 +262,7 @@ private: class VCL_DLLPUBLIC CurrencyFormatter : public NumericFormatter { protected: - CurrencyFormatter(); + CurrencyFormatter(Edit* pEdit); SAL_DLLPRIVATE void ImplCurrencyReformat( const OUString& rStr, OUString& rOutStr ); virtual sal_Int64 GetValueFromString(const OUString& rStr) const override; @@ -292,7 +292,7 @@ private: SAL_DLLPRIVATE void ImplInit(); protected: - DateFormatter(); + DateFormatter(Edit* pEdit); SAL_DLLPRIVATE const Date& ImplGetFieldDate() const { return maFieldDate; } SAL_DLLPRIVATE void ImplDateReformat( const OUString& rStr, OUString& rOutStr ); @@ -372,7 +372,7 @@ private: protected: tools::Time maFieldTime; - TimeFormatter(); + TimeFormatter(Edit* pEdit); SAL_DLLPRIVATE void ImplTimeReformat( const OUString& rStr, OUString& rOutStr ); SAL_DLLPRIVATE void ImplNewFieldValue( const tools::Time& rTime ); diff --git a/include/vcl/longcurr.hxx b/include/vcl/longcurr.hxx index 6e2aea73a052..3dff9278362c 100644 --- a/include/vcl/longcurr.hxx +++ b/include/vcl/longcurr.hxx @@ -57,7 +57,7 @@ protected: BigInt mnMin; BigInt mnMax; - LongCurrencyFormatter(); + LongCurrencyFormatter(Edit* pEdit); private: friend bool ImplLongCurrencyReformat( const OUString&, BigInt const &, BigInt const &, sal_uInt16, const LocaleDataWrapper&, OUString&, LongCurrencyFormatter const & ); SAL_DLLPRIVATE void ImpInit(); diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index d8df6d5ff42a..777a2f07d535 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -360,9 +360,9 @@ void ImplUpdateSeparators( const OUString& rOldDecSep, const OUString& rNewDecSe } // namespace -FormatterBase::FormatterBase() +FormatterBase::FormatterBase(Edit* pField) { - mpField = nullptr; + mpField = pField; mpLocaleDataWrapper = nullptr; mbReformat = false; mbStrictFormat = false; @@ -488,7 +488,8 @@ void NumericFormatter::ImplInit() SetDecimalDigits( 0 ); } -NumericFormatter::NumericFormatter() +NumericFormatter::NumericFormatter(Edit* pEdit) + : FormatterBase(pEdit) { ImplInit(); } @@ -728,16 +729,16 @@ sal_Int64 NumericFormatter::ClipAgainstMinMax(sal_Int64 nValue) const return nValue; } -NumericField::NumericField( vcl::Window* pParent, WinBits nWinStyle ) : - SpinField( pParent, nWinStyle ) +NumericField::NumericField(vcl::Window* pParent, WinBits nWinStyle) + : SpinField(pParent, nWinStyle) + , NumericFormatter(this) { - SetField( this ); Reformat(); } void NumericField::dispose() { - NumericFormatter::SetField( nullptr ); + ClearField(); SpinField::dispose(); } @@ -863,10 +864,10 @@ Size NumericField::CalcMinimumSize() const return calcMinimumSize(*this, *this); } -NumericBox::NumericBox( vcl::Window* pParent, WinBits nWinStyle ) : - ComboBox( pParent, nWinStyle ) +NumericBox::NumericBox(vcl::Window* pParent, WinBits nWinStyle) + : ComboBox(pParent, nWinStyle) + , NumericFormatter(this) { - SetField( this ); Reformat(); if ( !(nWinStyle & WB_HIDE ) ) Show(); @@ -874,7 +875,7 @@ NumericBox::NumericBox( vcl::Window* pParent, WinBits nWinStyle ) : void NumericBox::dispose() { - NumericFormatter::SetField( nullptr ); + ClearField(); ComboBox::dispose(); } @@ -1328,7 +1329,8 @@ inline void MetricFormatter::ImplInit() meUnit = MetricField::GetDefaultUnit(); } -MetricFormatter::MetricFormatter() +MetricFormatter::MetricFormatter(Edit* pEdit) + : NumericFormatter(pEdit) { ImplInit(); } @@ -1500,16 +1502,16 @@ sal_Int64 MetricFormatter::GetCorrectedValue( FieldUnit eOutUnit ) const meUnit, eOutUnit ); } -MetricField::MetricField( vcl::Window* pParent, WinBits nWinStyle ) : - SpinField( pParent, nWinStyle ) +MetricField::MetricField(vcl::Window* pParent, WinBits nWinStyle) + : SpinField(pParent, nWinStyle) + , MetricFormatter(this) { - SetField( this ); Reformat(); } void MetricField::dispose() { - MetricFormatter::SetField( nullptr ); + ClearField(); SpinField::dispose(); } @@ -1650,16 +1652,16 @@ void MetricField::CustomConvert() maCustomConvertLink.Call( *this ); } -MetricBox::MetricBox( vcl::Window* pParent, WinBits nWinStyle ) : - ComboBox( pParent, nWinStyle ) +MetricBox::MetricBox(vcl::Window* pParent, WinBits nWinStyle) + : ComboBox(pParent, nWinStyle) + , MetricFormatter(this) { - SetField( this ); Reformat(); } void MetricBox::dispose() { - MetricFormatter::SetField(nullptr); + ClearField(); ComboBox::dispose(); } @@ -1780,7 +1782,8 @@ void CurrencyFormatter::ImplCurrencyReformat( const OUString& rStr, OUString& rO rOutStr = CreateFieldText( nTempVal ); } -CurrencyFormatter::CurrencyFormatter() +CurrencyFormatter::CurrencyFormatter(Edit* pField) + : NumericFormatter(pField) { } @@ -1832,16 +1835,16 @@ void CurrencyFormatter::Reformat() SetValue( mnLastValue ); } -CurrencyField::CurrencyField( vcl::Window* pParent, WinBits nWinStyle ) : - SpinField( pParent, nWinStyle ) +CurrencyField::CurrencyField(vcl::Window* pParent, WinBits nWinStyle) + : SpinField(pParent, nWinStyle) + , CurrencyFormatter(this) { - SetField( this ); Reformat(); } void CurrencyField::dispose() { - CurrencyFormatter::SetField( nullptr ); + ClearField(); SpinField::dispose(); } @@ -1915,16 +1918,16 @@ void CurrencyField::Last() SpinField::Last(); } -CurrencyBox::CurrencyBox( vcl::Window* pParent, WinBits nWinStyle ) : - ComboBox( pParent, nWinStyle ) +CurrencyBox::CurrencyBox(vcl::Window* pParent, WinBits nWinStyle) + : ComboBox(pParent, nWinStyle) + , CurrencyFormatter(this) { - SetField( this ); Reformat(); } void CurrencyBox::dispose() { - CurrencyFormatter::SetField( nullptr ); + ClearField(); ComboBox::dispose(); } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 0adf18125322..3413d5533082 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -771,7 +771,8 @@ void PatternFormatter::ImplSetMask(const OString& rEditMask, const OUString& rLi } } -PatternFormatter::PatternFormatter() +PatternFormatter::PatternFormatter(Edit* pEdit) + : FormatterBase(pEdit) { mbSameMask = true; mbInPattKeyInput = false; @@ -816,16 +817,16 @@ void PatternFormatter::Reformat() } } -PatternField::PatternField( vcl::Window* pParent, WinBits nWinStyle ) : - SpinField( pParent, nWinStyle ) +PatternField::PatternField(vcl::Window* pParent, WinBits nWinStyle) + : SpinField(pParent, nWinStyle) + , PatternFormatter(this) { - SetField( this ); Reformat(); } void PatternField::dispose() { - PatternFormatter::SetField( nullptr ); + ClearField(); SpinField::dispose(); } @@ -868,16 +869,16 @@ void PatternField::Modify() SpinField::Modify(); } -PatternBox::PatternBox( vcl::Window* pParent, WinBits nWinStyle ) : - ComboBox( pParent, nWinStyle ) +PatternBox::PatternBox(vcl::Window* pParent, WinBits nWinStyle) + : ComboBox( pParent, nWinStyle ) + , PatternFormatter(this) { - SetField( this ); Reformat(); } void PatternBox::dispose() { - PatternFormatter::SetField( nullptr ); + ClearField(); ComboBox::dispose(); } @@ -1409,7 +1410,8 @@ void DateFormatter::ImplInit() mnExtDateFormat = ExtDateFieldFormat::SystemShort; } -DateFormatter::DateFormatter() : +DateFormatter::DateFormatter(Edit* pEdit) : + FormatterBase(pEdit), maFieldDate( 0 ), maLastDate( 0 ), maMin( 1, 1, 1900 ), @@ -1702,10 +1704,10 @@ void DateFormatter::ExpandCentury( Date& rDate, sal_uInt16 nTwoDigitYearStart ) DateField::DateField( vcl::Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ), + DateFormatter(this), maFirst( GetMin() ), maLast( GetMax() ) { - SetField( this ); SetText( ImplGetLocaleDataWrapper().getDate( ImplGetFieldDate() ) ); Reformat(); ResetLastDate(); @@ -1713,7 +1715,7 @@ DateField::DateField( vcl::Window* pParent, WinBits nWinStyle ) : void DateField::dispose() { - DateFormatter::SetField( nullptr ); + ClearField(); SpinField::dispose(); } @@ -1808,17 +1810,17 @@ void DateField::Last() SpinField::Last(); } -DateBox::DateBox( vcl::Window* pParent, WinBits nWinStyle ) : - ComboBox( pParent, nWinStyle ) +DateBox::DateBox(vcl::Window* pParent, WinBits nWinStyle) + : ComboBox( pParent, nWinStyle ) + , DateFormatter(this) { - SetField( this ); SetText( ImplGetLocaleDataWrapper().getDate( ImplGetFieldDate() ) ); Reformat(); } void DateBox::dispose() { - DateFormatter::SetField( nullptr ); + ClearField(); ComboBox::dispose(); } @@ -2303,7 +2305,8 @@ void TimeFormatter::ImplInit() mnTimeFormat = TimeFormat::Hour24; // Should become a ExtTimeFieldFormat in next implementation, merge with mbDuration and meFormat } -TimeFormatter::TimeFormatter() : +TimeFormatter::TimeFormatter(Edit* pEdit) : + FormatterBase(pEdit), maLastTime( 0, 0 ), maMin( 0, 0 ), maMax( 23, 59, 59, 999999999 ), @@ -2507,17 +2510,17 @@ void TimeFormatter::Reformat() TimeField::TimeField( vcl::Window* pParent, WinBits nWinStyle ) : SpinField( pParent, nWinStyle ), + TimeFormatter(this), maFirst( GetMin() ), maLast( GetMax() ) { - SetField( this ); SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, false ) ); Reformat(); } void TimeField::dispose() { - TimeFormatter::SetField( nullptr ); + ClearField(); SpinField::dispose(); } @@ -2623,17 +2626,17 @@ void TimeField::SetExtFormat( ExtTimeFieldFormat eFormat ) ReformatAll(); } -TimeBox::TimeBox( vcl::Window* pParent, WinBits nWinStyle ) : - ComboBox( pParent, nWinStyle ) +TimeBox::TimeBox(vcl::Window* pParent, WinBits nWinStyle) + : ComboBox(pParent, nWinStyle) + , TimeFormatter(this) { - SetField( this ); SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime, false ) ); Reformat(); } void TimeBox::dispose() { - TimeFormatter::SetField( nullptr ); + ClearField(); ComboBox::dispose(); } diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 6418e1cb30e1..03820f9792fa 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -252,7 +252,8 @@ void LongCurrencyFormatter::ImpInit() SetDecimalDigits( 0 ); } -LongCurrencyFormatter::LongCurrencyFormatter() +LongCurrencyFormatter::LongCurrencyFormatter(Edit* pEdit) + : FormatterBase(pEdit) { ImpInit(); } @@ -399,10 +400,10 @@ void ImplNewLongCurrencyFieldValue(LongCurrencyField* pField, const BigInt& rNew pField->Modify(); } -LongCurrencyField::LongCurrencyField( vcl::Window* pParent, WinBits nWinStyle ) : - SpinField( pParent, nWinStyle ) +LongCurrencyField::LongCurrencyField(vcl::Window* pParent, WinBits nWinStyle) + : SpinField( pParent, nWinStyle ) + , LongCurrencyFormatter(this) { - SetField( this ); mnSpinSize = 1; mnFirst = mnMin; mnLast = mnMax; @@ -467,10 +468,10 @@ void LongCurrencyField::Last() SpinField::Last(); } -LongCurrencyBox::LongCurrencyBox( vcl::Window* pParent, WinBits nWinStyle ) : - ComboBox( pParent, nWinStyle ) +LongCurrencyBox::LongCurrencyBox(vcl::Window* pParent, WinBits nWinStyle) + : ComboBox(pParent, nWinStyle) + , LongCurrencyFormatter(this) { - SetField( this ); Reformat(); } commit 7d73c1c00c14df7cd130db1f7196a1bfe5155a83 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Nov 7 21:10:52 2018 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Nov 8 10:00:27 2018 +0100 SetField/GetField do not need to be public Change-Id: I5989ce6485656f6ddb8f4994e8764cfa278d9ecb Reviewed-on: https://gerrit.libreoffice.org/63047 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index aec107f49629..faf37bb2cd58 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -55,15 +55,15 @@ protected: SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const; + void SetField( Edit* pField ) { mpField = pField; } + Edit* GetField() const { return mpField; } + public: explicit FormatterBase(); virtual ~FormatterBase(); const LocaleDataWrapper& GetLocaleDataWrapper() const; - void SetField( Edit* pField ) { mpField = pField; } - Edit* GetField() const { return mpField; } - bool MustBeReformatted() const { return mbReformat; } void MarkToBeReformatted( bool b ) { mbReformat = b; } commit 1abda793895be7d9224a8cd00483497cd761476c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Nov 7 17:30:34 2018 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Nov 8 10:00:02 2018 +0100 mbDefaultLocale is always true Change-Id: I92bcb381330a129ca42a2407a3e4db0ed044ed51 Reviewed-on: https://gerrit.libreoffice.org/63041 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index e9407fa66f32..aec107f49629 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -46,7 +46,6 @@ private: bool mbStrictFormat; bool mbEmptyFieldValue; bool mbEmptyFieldValueEnabled; - bool mbDefaultLocale; protected: SAL_DLLPRIVATE void ImplSetText( const OUString& rText, Selection const * pNewSel = nullptr ); @@ -55,7 +54,6 @@ protected: void SetEmptyFieldValueData( bool bValue ) { mbEmptyFieldValue = bValue; } SAL_DLLPRIVATE LocaleDataWrapper& ImplGetLocaleDataWrapper() const; - bool IsDefaultLocale() const { return mbDefaultLocale; } public: explicit FormatterBase(); diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 07c10c50a138..d8df6d5ff42a 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -368,7 +368,6 @@ FormatterBase::FormatterBase() mbStrictFormat = false; mbEmptyFieldValue = false; mbEmptyFieldValueEnabled = false; - mbDefaultLocale = true; } FormatterBase::~FormatterBase() @@ -410,28 +409,18 @@ void FormatterBase::SetStrictFormat( bool bStrict ) const lang::Locale& FormatterBase::GetLocale() const { - if ( !mpLocaleDataWrapper || mbDefaultLocale ) - { - if ( mpField ) - return mpField->GetSettings().GetLanguageTag().getLocale(); - else - return Application::GetSettings().GetLanguageTag().getLocale(); - } - - return mpLocaleDataWrapper->getLanguageTag().getLocale(); + if ( mpField ) + return mpField->GetSettings().GetLanguageTag().getLocale(); + else + return Application::GetSettings().GetLanguageTag().getLocale(); } const LanguageTag& FormatterBase::GetLanguageTag() const { - if ( !mpLocaleDataWrapper || mbDefaultLocale ) - { - if ( mpField ) - return mpField->GetSettings().GetLanguageTag(); - else - return Application::GetSettings().GetLanguageTag(); - } - - return mpLocaleDataWrapper->getLanguageTag(); + if ( mpField ) + return mpField->GetSettings().GetLanguageTag(); + else + return Application::GetSettings().GetLanguageTag(); } void FormatterBase::ImplSetText( const OUString& rText, Selection const * pNewSelection ) @@ -797,8 +786,7 @@ void NumericField::DataChanged( const DataChangedEvent& rDCEvt ) { OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep, this ); @@ -936,8 +924,7 @@ void NumericBox::DataChanged( const DataChangedEvent& rDCEvt ) { OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep, this ); @@ -1620,8 +1607,7 @@ void MetricField::DataChanged( const DataChangedEvent& rDCEvt ) { OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep, this ); @@ -1723,8 +1709,7 @@ void MetricBox::DataChanged( const DataChangedEvent& rDCEvt ) { OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep, this ); @@ -1892,8 +1877,7 @@ void CurrencyField::DataChanged( const DataChangedEvent& rDCEvt ) { OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep, this ); @@ -1976,8 +1960,7 @@ void CurrencyBox::DataChanged( const DataChangedEvent& rDCEvt ) { OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep, this ); diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index 912b104eb56e..0adf18125322 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -1772,7 +1772,7 @@ void DateField::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & (AllSettingsFlags::LOCALE|AllSettingsFlags::MISC)) ) { - if ( IsDefaultLocale() && ( rDCEvt.GetFlags() & AllSettingsFlags::LOCALE ) ) + if (rDCEvt.GetFlags() & AllSettingsFlags::LOCALE) ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); ReformatAll(); } @@ -1841,8 +1841,7 @@ void DateBox::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::LOCALE) ) { - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); ReformatAll(); } } @@ -2563,8 +2562,7 @@ void TimeField::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::LOCALE) ) { - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); ReformatAll(); } } @@ -2669,8 +2667,7 @@ void TimeBox::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::LOCALE) ) { - if ( IsDefaultLocale() ) - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); + ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); ReformatAll(); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits