vcl/source/uitest/uiobject.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
New commits: commit a7699fc27240f1329602a5d442667c326525ad55 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Mon Jul 9 00:48:16 2018 +0200 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.mohrh...@googlemail.com> 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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits