diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-26 01:20:10 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-26 02:55:55 +0000 |
commit | 013e5bacc65710f9412de2287749a84e469056a0 (patch) | |
tree | 9f5fba36fe74d5a6157ec8478e8a8ffe1bed0f01 /vcl/source/uitest | |
parent | 8d65a2076ee9e76ce2301762fd147cea7091aae4 (diff) |
uitest: handle float windows better in the hierarchy dump
Change-Id: Ic49ac5774116bf9d8af980ecc0d99b0056fc8bed
Reviewed-on: https://gerrit.libreoffice.org/35695
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'vcl/source/uitest')
-rw-r--r-- | vcl/source/uitest/uiobject.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 3dabf7a0e56f..24fac7a4dd31 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -93,16 +93,25 @@ bool isDialogWindow(vcl::Window* pWindow) return false; } -vcl::Window* get_dialog_parent(vcl::Window* pWindow) +bool isTopWindow(vcl::Window* pWindow) { - if (isDialogWindow(pWindow)) + WindowType eType = pWindow->GetType(); + if (eType == WindowType::FLOATINGWINDOW) + return true; + + return false; +} + +vcl::Window* get_top_parent(vcl::Window* pWindow) +{ + if (isDialogWindow(pWindow) || isTopWindow(pWindow)) return pWindow; vcl::Window* pParent = pWindow->GetParent(); if (!pParent) return pWindow; - return get_dialog_parent(pParent); + return get_top_parent(pParent); } std::vector<KeyEvent> generate_key_events_from_text(const OUString& rStr) @@ -409,7 +418,7 @@ void addChildren(vcl::Window* pParent, std::set<OUString>& rChildren) std::unique_ptr<UIObject> WindowUIObject::get_child(const OUString& rID) { - vcl::Window* pDialogParent = get_dialog_parent(mxWindow.get()); + vcl::Window* pDialogParent = get_top_parent(mxWindow.get()); vcl::Window* pWindow = findChild(pDialogParent, rID); if (!pWindow) @@ -421,7 +430,7 @@ std::unique_ptr<UIObject> WindowUIObject::get_child(const OUString& rID) std::set<OUString> WindowUIObject::get_children() const { - vcl::Window* pDialogParent = get_dialog_parent(mxWindow.get()); + vcl::Window* pDialogParent = get_top_parent(mxWindow.get()); std::set<OUString> aChildren; aChildren.insert(pDialogParent->get_id()); addChildren(pDialogParent, aChildren); @@ -473,7 +482,7 @@ OUString WindowUIObject::dumpState() const OUString WindowUIObject::dumpHierarchy() const { - vcl::Window* pDialogParent = get_dialog_parent(mxWindow.get()); + vcl::Window* pDialogParent = get_top_parent(mxWindow.get()); std::unique_ptr<UIObject> pParentWrapper = pDialogParent->GetUITestFactory()(pDialogParent); return pParentWrapper->dumpState(); |