include/vcl/field.hxx | 1 + include/vcl/uitest/uiobject.hxx | 2 ++ vcl/source/control/field.cxx | 6 ++++++ vcl/source/uitest/uiobject.cxx | 8 ++++++++ 4 files changed, 17 insertions(+)
New commits: commit f228d4af56769f2d81915a969c95fee0e088235b Author: Henry Castro <[email protected]> AuthorDate: Thu May 7 18:45:28 2020 -0400 Commit: Henry Castro <[email protected]> CommitDate: Thu May 21 00:45:14 2020 +0200 lok: override get_state of the MetricFieldObject class used for unit testing Change-Id: I7d8ed976837b488bfb22d865583b8d4f1f0978ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93776 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Henry Castro <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94524 Tested-by: Henry Castro <[email protected]> diff --git a/include/vcl/field.hxx b/include/vcl/field.hxx index b116615488e1..654dbbe77780 100644 --- a/include/vcl/field.hxx +++ b/include/vcl/field.hxx @@ -154,6 +154,7 @@ public: sal_Int64 Normalize( sal_Int64 nValue ) const; sal_Int64 Denormalize( sal_Int64 nValue ) const; + OUString GetValueString() const; virtual void SetValueFromString(const OUString& rStr); protected: diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index d1377a811f12..03d45ba59051 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -395,6 +395,8 @@ public: virtual void execute(const OUString& rAction, const StringMap& rParameters) override; + virtual StringMap get_state() override; + static std::unique_ptr<UIObject> create(vcl::Window* pWindow); protected: diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 1bc74316d8f9..2b00cb833c76 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -666,6 +666,12 @@ sal_Int64 NumericFormatter::GetValueFromString(const OUString& rStr) const return mnLastValue; } +OUString NumericFormatter::GetValueString() const +{ + return Application::GetSettings().GetNeutralLocaleDataWrapper(). + getNum(GetValue(), GetDecimalDigits(), false, false); +} + // currently used by online void NumericFormatter::SetValueFromString(const OUString& rStr) { diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 2fd1a1b0dcaa..a7bb1ae2e288 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -1313,6 +1313,14 @@ void MetricFieldUIObject::execute(const OUString& rAction, SpinFieldUIObject::execute(rAction, rParameters); } +StringMap MetricFieldUIObject::get_state() +{ + StringMap aMap = EditUIObject::get_state(); + aMap["Value"] = mxMetricField->GetValueString(); + + return aMap; +} + OUString MetricFieldUIObject::get_name() const { return OUString("MetricFieldUIObject"); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
