From 540a6554956bbee62b5f669d672d64e03a9d888c Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sun, 10 Apr 2016 07:02:23 +0200 Subject: uitest: an enum is a bad idea for the type Change-Id: I1efd59b2f664f0aa9be733466fa7c1057e92ef27 --- include/vcl/uitest/uiobject.hxx | 38 ++------------------------ sfx2/inc/uitest/sfx_uiobject.hxx | 2 -- sfx2/source/uitest/sfx_uiobject.cxx | 5 ---- svtools/inc/uitest/uiobject.hxx | 2 -- svtools/source/uitest/uiobject.cxx | 5 ---- vcl/source/uitest/uiobject.cxx | 53 +++---------------------------------- 6 files changed, 6 insertions(+), 99 deletions(-) diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 963003e1ed3e..b9a3f484b58f 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -22,21 +22,6 @@ #include -enum class UIObjectType -{ - WINDOW, - DIALOG, - BUTTON, - EDIT, - CHECKBOX, - LISTBOX, - COMBOBOX, - SPINBUTTON, - TABPAGE, - SPINFIELD, - UNKNOWN -}; - typedef std::map StringMap; /** @@ -67,9 +52,8 @@ public: /** * Returns the type of the UIObject. Additional information might * be available through UIObject::get_state(). - * */ - virtual UIObjectType get_type() const; + virtual OUString get_type() const; /** * Returns the child of the current UIObject with the corresponding id. @@ -108,7 +92,7 @@ public: virtual void execute(const OUString& rAction, const StringMap& rParameters) override; - virtual UIObjectType get_type() const override; + virtual OUString get_type() const override; virtual std::unique_ptr get_child(const OUString& rID) override; @@ -138,8 +122,6 @@ public: virtual void execute(const OUString& rAction, const StringMap& rParameters) override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: @@ -156,8 +138,6 @@ public: DialogUIObject(VclPtr xDialog); virtual ~DialogUIObject(); - virtual UIObjectType get_type() const override; - virtual StringMap get_state() override; static std::unique_ptr create(vcl::Window* pWindow); @@ -181,8 +161,6 @@ public: virtual StringMap get_state() override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: @@ -205,8 +183,6 @@ public: virtual StringMap get_state() override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: @@ -227,8 +203,6 @@ public: virtual StringMap get_state() override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: @@ -251,8 +225,6 @@ public: virtual StringMap get_state() override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: @@ -276,8 +248,6 @@ public: virtual StringMap get_state() override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: @@ -300,8 +270,6 @@ public: virtual StringMap get_state() override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: @@ -323,8 +291,6 @@ public: virtual StringMap get_state() override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: diff --git a/sfx2/inc/uitest/sfx_uiobject.hxx b/sfx2/inc/uitest/sfx_uiobject.hxx index 9a9277220cbd..470e70053a57 100644 --- a/sfx2/inc/uitest/sfx_uiobject.hxx +++ b/sfx2/inc/uitest/sfx_uiobject.hxx @@ -29,8 +29,6 @@ public: virtual void execute(const OUString& rAction, const StringMap& rParameters) override; - virtual UIObjectType get_type() const override; - static std::unique_ptr create(vcl::Window* pWindow); protected: diff --git a/sfx2/source/uitest/sfx_uiobject.cxx b/sfx2/source/uitest/sfx_uiobject.cxx index 1f416277b497..6a45ab3ca6d2 100644 --- a/sfx2/source/uitest/sfx_uiobject.cxx +++ b/sfx2/source/uitest/sfx_uiobject.cxx @@ -75,11 +75,6 @@ void SfxTabDialogUIObject::execute(const OUString& rAction, } } -UIObjectType SfxTabDialogUIObject::get_type() const -{ - return UIObjectType::DIALOG; -} - std::unique_ptr SfxTabDialogUIObject::create(vcl::Window* pWindow) { SfxTabDialog* pDialog = dynamic_cast(pWindow); diff --git a/svtools/inc/uitest/uiobject.hxx b/svtools/inc/uitest/uiobject.hxx index 8e7cbcecb1c8..294942176a64 100644 --- a/svtools/inc/uitest/uiobject.hxx +++ b/svtools/inc/uitest/uiobject.hxx @@ -16,8 +16,6 @@ class TreeListUIObject : public WindowUIObject public: TreeListUIObject(VclPtr xTreeList); - virtual UIObjectType get_type() const override; - virtual StringMap get_state() override; static std::unique_ptr create(vcl::Window* pWindow); diff --git a/svtools/source/uitest/uiobject.cxx b/svtools/source/uitest/uiobject.cxx index db345487909c..65cd4a7d1cb7 100644 --- a/svtools/source/uitest/uiobject.cxx +++ b/svtools/source/uitest/uiobject.cxx @@ -21,11 +21,6 @@ StringMap TreeListUIObject::get_state() return WindowUIObject::get_state(); } -UIObjectType TreeListUIObject::get_type() const -{ - return UIObjectType::WINDOW; -} - OUString TreeListUIObject::get_name() const { return OUString("TreeListUIObject"); diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index e61a1d0739aa..214f69105321 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -44,9 +44,9 @@ void UIObject::execute(const OUString& /*rAction*/, throw std::exception(); } -UIObjectType UIObject::get_type() const +OUString UIObject::get_type() const { - return UIObjectType::UNKNOWN; + return OUString("Generic UIObject"); } std::unique_ptr UIObject::get_child(const OUString&) @@ -212,9 +212,9 @@ void WindowUIObject::execute(const OUString& rAction, } } -UIObjectType WindowUIObject::get_type() const +OUString WindowUIObject::get_type() const { - return UIObjectType::WINDOW; + return get_name(); } namespace { @@ -308,11 +308,6 @@ StringMap ButtonUIObject::get_state() return aMap; } -UIObjectType ButtonUIObject::get_type() const -{ - return UIObjectType::BUTTON; -} - void ButtonUIObject::execute(const OUString& rAction, const StringMap& rParameters) { @@ -357,11 +352,6 @@ OUString DialogUIObject::get_name() const return OUString("DialogUIObject"); } -UIObjectType DialogUIObject::get_type() const -{ - return UIObjectType::DIALOG; -} - std::unique_ptr DialogUIObject::create(vcl::Window* pWindow) { Dialog* pDialog = dynamic_cast(pWindow); @@ -430,11 +420,6 @@ StringMap EditUIObject::get_state() return aMap; } -UIObjectType EditUIObject::get_type() const -{ - return UIObjectType::EDIT; -} - OUString EditUIObject::get_name() const { return OUString("EditUIObject"); @@ -475,11 +460,6 @@ StringMap CheckBoxUIObject::get_state() return aMap; } -UIObjectType CheckBoxUIObject::get_type() const -{ - return UIObjectType::CHECKBOX; -} - OUString CheckBoxUIObject::get_name() const { return OUString("CheckBoxUIObject"); @@ -518,11 +498,6 @@ StringMap TabPageUIObject::get_state() return aMap; } -UIObjectType TabPageUIObject::get_type() const -{ - return UIObjectType::TABPAGE; -} - OUString TabPageUIObject::get_name() const { return OUString("TabPageUIObject"); @@ -575,11 +550,6 @@ StringMap ListBoxUIObject::get_state() return aMap; } -UIObjectType ListBoxUIObject::get_type() const -{ - return UIObjectType::LISTBOX; -} - OUString ListBoxUIObject::get_name() const { return OUString("ListBoxUIObject"); @@ -625,11 +595,6 @@ StringMap ComboBoxUIObject::get_state() return aMap; } -UIObjectType ComboBoxUIObject::get_type() const -{ - return UIObjectType::COMBOBOX; -} - OUString ComboBoxUIObject::get_name() const { return OUString("ComboBoxUIObject"); @@ -675,11 +640,6 @@ StringMap SpinUIObject::get_state() return aMap; } -UIObjectType SpinUIObject::get_type() const -{ - return UIObjectType::SPINBUTTON; -} - OUString SpinUIObject::get_name() const { return OUString("SpinUIObject"); @@ -715,11 +675,6 @@ StringMap SpinFieldUIObject::get_state() return aMap; } -UIObjectType SpinFieldUIObject::get_type() const -{ - return UIObjectType::SPINFIELD; -} - OUString SpinFieldUIObject::get_name() const { return OUString("SpinFieldUIObject"); -- cgit