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 /starmath/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 'starmath/source')
-rw-r--r-- | starmath/source/uiobject.cxx | 13 | ||||
-rw-r--r-- | starmath/source/uiobject.hxx | 4 |
2 files changed, 7 insertions, 10 deletions
diff --git a/starmath/source/uiobject.cxx b/starmath/source/uiobject.cxx index a6f0c47cbd9b..5d7519816e52 100644 --- a/starmath/source/uiobject.cxx +++ b/starmath/source/uiobject.cxx @@ -9,7 +9,6 @@ #include <memory> #include "uiobject.hxx" -#include <vcl/layout.hxx> #include <ElementsDockingWindow.hxx> ElementUIObject::ElementUIObject(SmElementsControl* pElementSelector, @@ -52,15 +51,15 @@ void ElementUIObject::execute(const OUString& rAction, } } -ElementSelectorUIObject::ElementSelectorUIObject(vcl::Window* pElementSelectorWindow, SmElementsControl* pElementSelector) - : WindowUIObject(pElementSelectorWindow) - , mpElementsSelector(pElementSelector) +ElementSelectorUIObject::ElementSelectorUIObject(vcl::Window* pElementSelectorWindow) + : DrawingAreaUIObject(pElementSelectorWindow) + , mpElementsSelector(static_cast<SmElementsControl*>(mpController)) { } StringMap ElementSelectorUIObject::get_state() { - StringMap aMap = WindowUIObject::get_state(); + StringMap aMap = DrawingAreaUIObject::get_state(); SmElement* pElement = mpElementsSelector->current(); if (pElement) @@ -96,9 +95,7 @@ std::set<OUString> ElementSelectorUIObject::get_children() const std::unique_ptr<UIObject> ElementSelectorUIObject::create(vcl::Window* pWindow) { - VclDrawingArea* pSmElementsWin = dynamic_cast<VclDrawingArea*>(pWindow); - assert(pSmElementsWin); - return std::unique_ptr<UIObject>(new ElementSelectorUIObject(pSmElementsWin, static_cast<SmElementsControl*>(pSmElementsWin->GetUserData()))); + return std::unique_ptr<UIObject>(new ElementSelectorUIObject(pWindow)); } OUString ElementSelectorUIObject::get_name() const diff --git a/starmath/source/uiobject.hxx b/starmath/source/uiobject.hxx index 607c9194c85d..e6132ff772a8 100644 --- a/starmath/source/uiobject.hxx +++ b/starmath/source/uiobject.hxx @@ -35,14 +35,14 @@ private: SmElement* get_element(); }; -class ElementSelectorUIObject : public WindowUIObject +class ElementSelectorUIObject : public DrawingAreaUIObject { private: SmElementsControl* mpElementsSelector; public: - explicit ElementSelectorUIObject(vcl::Window* pElementSelectorWindow, SmElementsControl* pElementSelector); + explicit ElementSelectorUIObject(vcl::Window* pElementSelectorWindow); virtual StringMap get_state() override; |