include/vcl/toolkit/field.hxx | 24 --------- vcl/source/control/field.cxx | 108 ------------------------------------------ 2 files changed, 132 deletions(-)
New commits: commit 4b5fe30b437d62ad72354ed72752438e0544eaa0 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Jul 23 14:54:43 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jul 24 10:24:23 2020 +0200 NumericField is unused Change-Id: I9ada46d4c5cc0b2ebf45f062083ba34ebe3d8270 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99320 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/toolkit/field.hxx b/include/vcl/toolkit/field.hxx index 1665e785df3f..f4a2874aedae 100644 --- a/include/vcl/toolkit/field.hxx +++ b/include/vcl/toolkit/field.hxx @@ -155,30 +155,6 @@ private: }; -class UNLESS_MERGELIBS(VCL_DLLPUBLIC) NumericField : public SpinField, public NumericFormatter -{ -public: - explicit NumericField( vcl::Window* pParent, WinBits nWinStyle ); - - virtual bool PreNotify( NotifyEvent& rNEvt ) override; - virtual bool EventNotify( NotifyEvent& rNEvt ) override; - virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; - - virtual Size CalcMinimumSize() const override; - - virtual void Modify() override; - - virtual void Up() override; - virtual void Down() override; - virtual void First() override; - virtual void Last() override; - virtual bool set_property(const OString &rKey, const OUString &rValue) override; - virtual void dispose() override; - - virtual void DumpAsPropertyTree(tools::JsonWriter&) override; -}; - - class VCL_DLLPUBLIC MetricFormatter : public NumericFormatter { public: diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index f18005f0bb57..bc6328d1adfc 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -776,109 +776,6 @@ sal_Int64 NumericFormatter::ClipAgainstMinMax(sal_Int64 nValue) const return nValue; } -NumericField::NumericField(vcl::Window* pParent, WinBits nWinStyle) - : SpinField(pParent, nWinStyle) - , NumericFormatter(this) -{ - Reformat(); -} - -void NumericField::dispose() -{ - ClearField(); - SpinField::dispose(); -} - -bool NumericField::set_property(const OString &rKey, const OUString &rValue) -{ - if (rKey == "digits") - SetDecimalDigits(rValue.toInt32()); - else if (rKey == "spin-size") - SetSpinSize(rValue.toInt32()); - else if (rKey == "wrap") - mbWrapOnLimits = toBool(rValue); - else - return SpinField::set_property(rKey, rValue); - return true; -} - -bool NumericField::PreNotify( NotifyEvent& rNEvt ) -{ - if ( (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) - { - if ( ImplNumericProcessKeyInput( *rNEvt.GetKeyEvent(), IsStrictFormat(), IsUseThousandSep(), ImplGetLocaleDataWrapper() ) ) - return true; - } - - return SpinField::PreNotify( rNEvt ); -} - -bool NumericField::EventNotify( NotifyEvent& rNEvt ) -{ - if ( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS ) - MarkToBeReformatted( false ); - else if ( rNEvt.GetType() == MouseNotifyEvent::LOSEFOCUS ) - { - if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) ) - Reformat(); - } - - return SpinField::EventNotify( rNEvt ); -} - -void NumericField::DataChanged( const DataChangedEvent& rDCEvt ) -{ - SpinField::DataChanged( rDCEvt ); - - if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::LOCALE) ) - { - OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); - OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() ); - OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep(); - OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep(); - ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep, this ); - ReformatAll(); - } -} - -void NumericField::Modify() -{ - MarkToBeReformatted( true ); - SpinField::Modify(); -} - -void NumericField::Up() -{ - FieldUp(); - SpinField::Up(); -} - -void NumericField::Down() -{ - FieldDown(); - SpinField::Down(); -} - -void NumericField::First() -{ - FieldFirst(); - SpinField::First(); -} - -void NumericField::Last() -{ - FieldLast(); - SpinField::Last(); -} - -void NumericField::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) -{ - SpinField::DumpAsPropertyTree(rJsonWriter); - rJsonWriter.put("min", GetMin()); - rJsonWriter.put("max", GetMax()); -} - namespace { Size calcMinimumSize(const Edit &rSpinField, const NumericFormatter &rFormatter) @@ -915,11 +812,6 @@ namespace } } -Size NumericField::CalcMinimumSize() const -{ - return calcMinimumSize(*this, *this); -} - NumericBox::NumericBox(vcl::Window* pParent, WinBits nWinStyle) : ComboBox(pParent, nWinStyle) , NumericFormatter(this) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits