diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-09 00:48:16 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-09 01:57:08 +0200 |
commit | a7699fc27240f1329602a5d442667c326525ad55 (patch) | |
tree | 81714f3790ad7c84d546997c3bdd0446a360af77 /vcl/source | |
parent | 9d7166b448198875bdff43d7054d0f5914e675de (diff) |
uitest: test for ui elements children first
Change-Id: I837721533bc40cea55cbccaa14e1f14686aa3e3a
Reviewed-on: https://gerrit.libreoffice.org/57165
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/uitest/uiobject.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 1a292862ec52..0540b9ba0ec4 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -421,8 +421,15 @@ void addChildren(vcl::Window const * pParent, std::set<OUString>& rChildren) std::unique_ptr<UIObject> WindowUIObject::get_child(const OUString& rID) { - vcl::Window* pDialogParent = get_top_parent(mxWindow.get()); - vcl::Window* pWindow = findChild(pDialogParent, rID); + // in a first step try the real children before moving to the top level parent + // This makes it easier to handle cases with the same ID as there is a way + // to resolve conflicts + vcl::Window* pWindow = findChild(mxWindow.get(), rID); + if (!pWindow) + { + vcl::Window* pDialogParent = get_top_parent(mxWindow.get()); + pWindow = findChild(pDialogParent, rID); + } if (!pWindow) throw css::uno::RuntimeException("Could not find child with id: " + rID); |