diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-15 11:07:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-16 12:55:07 +0200 |
commit | d3fff9073f70bdd9caf619a9cfe7afd7c04cffe1 (patch) | |
tree | f48b9b4f8478613fcade0cef9f6f12fdde5b41b4 /svtools | |
parent | 2e412c5354134fe3cd66ea0266011c5b87dc9eb3 (diff) |
add a DrawingAreaUIObject to avoid need to include layout.hxx for uitest
Change-Id: I2d7f9d38f9eac5af7b8b4d738335507beb6627df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104357
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/inc/uiobject.hxx | 6 | ||||
-rw-r--r-- | svtools/source/uitest/uiobject.cxx | 18 |
2 files changed, 10 insertions, 14 deletions
diff --git a/svtools/inc/uiobject.hxx b/svtools/inc/uiobject.hxx index a27b6d68fdad..b201555179c4 100644 --- a/svtools/inc/uiobject.hxx +++ b/svtools/inc/uiobject.hxx @@ -16,12 +16,12 @@ class ValueSet; -class ValueSetUIObject final : public WindowUIObject +class ValueSetUIObject final : public DrawingAreaUIObject { ValueSet* mpSet; public: - ValueSetUIObject(const VclPtr<vcl::Window>& xSetWin, ValueSet* pSet); + ValueSetUIObject(const VclPtr<vcl::Window>& xSetWin); virtual void execute(const OUString& rAction, const StringMap& rParameters) override; @@ -35,4 +35,4 @@ private: #endif // INCLUDED_SVX_INC_UIOBJECT_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx index db593581d6c2..0b3d78daf7b0 100644 --- a/svtools/source/uitest/uiobject.cxx +++ b/svtools/source/uitest/uiobject.cxx @@ -10,11 +10,10 @@ #include <memory> #include <uiobject.hxx> #include <svtools/valueset.hxx> -#include <vcl/layout.hxx> -ValueSetUIObject::ValueSetUIObject(const VclPtr<vcl::Window>& xSetWin, ValueSet* pSet) - : WindowUIObject(xSetWin) - , mpSet(pSet) +ValueSetUIObject::ValueSetUIObject(const VclPtr<vcl::Window>& rSetWin) + : DrawingAreaUIObject(rSetWin) + , mpSet(static_cast<ValueSet*>(mpController)) { } @@ -32,26 +31,23 @@ void ValueSetUIObject::execute(const OUString& rAction, const StringMap& rParame } } else - WindowUIObject::execute(rAction, rParameters); + DrawingAreaUIObject::execute(rAction, rParameters); } std::unique_ptr<UIObject> ValueSetUIObject::create(vcl::Window* pWindow) { - VclDrawingArea* pSetWin = dynamic_cast<VclDrawingArea*>(pWindow); - assert(pSetWin); - return std::unique_ptr<UIObject>( - new ValueSetUIObject(pSetWin, static_cast<ValueSet*>(pSetWin->GetUserData()))); + return std::unique_ptr<UIObject>(new ValueSetUIObject(pWindow)); } OUString ValueSetUIObject::get_name() const { return "ValueSetUIObject"; } StringMap ValueSetUIObject::get_state() { - StringMap aMap = WindowUIObject::get_state(); + StringMap aMap = DrawingAreaUIObject::get_state(); aMap["SelectedItemId"] = OUString::number(mpSet->GetSelectedItemId()); aMap["SelectedItemPos"] = OUString::number(mpSet->GetSelectItemPos()); aMap["ItemsCount"] = OUString::number(mpSet->GetItemCount()); return aMap; } -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |