[Libreoffice-commits] core.git: vcl/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Jul 8 23:57:30 UTC 2018


 vcl/source/uitest/uiobject.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit a7699fc27240f1329602a5d442667c326525ad55
Author: Markus Mohrhard <markus.mohrhard at 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.mohrhard at 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);


More information about the Libreoffice-commits mailing list