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/source | |
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/source')
-rw-r--r-- | svtools/source/uitest/uiobject.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
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: */ |