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

Saurav Chirania saurav.chir at gmail.com
Thu Jul 12 05:58:28 UTC 2018


 vcl/source/uitest/logger.cxx |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 7140644302d97869c7ea8d636123755fe04e640b
Author: Saurav Chirania <saurav.chir at gmail.com>
Date:   Tue Jul 10 18:34:55 2018 +0530

    uitest logger: log key according to DSL inside dialogs too
    
    Change-Id: I30cfbf7ba87dda43ecb75ffd5f69253d77b6a00b
    Reviewed-on: https://gerrit.libreoffice.org/57233
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 69620b0df610..54ac483ed627 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -96,7 +96,9 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key
     if (!mbValid)
         return;
 
-    const OUString& rID = xUIElement->get_id();
+    //We need to check for Parent's ID in case the UI Element is SubEdit of Combobox/SpinField
+    const OUString& rID = xUIElement->get_id().isEmpty() ?
+        xUIElement->GetParent()->get_id() : xUIElement->get_id();
     if (rID.isEmpty())
         return;
 
@@ -159,10 +161,17 @@ void UITestLogger::logKeyInput(VclPtr<vcl::Window> const & xUIElement, const Key
 
     std::unique_ptr<UIObject> pUIObject = xUIElement->GetUITestFactory()(xUIElement.get());
 
-    OUString parent_id = xUIElement->GetParent()->get_id();
+    VclPtr <vcl::Window> pParent = xUIElement->GetParent();
+
+    while (!pParent->IsTopWindow())
+    {
+        pParent = pParent->GetParent();
+    }
+
+    OUString aParentID = pParent->get_id();
 
     OUString aContent = pUIObject->get_type() + " Action:TYPE Id:" +
-            rID + " Parent:"+ parent_id +" " + aKeyCode;
+            rID + " Parent:"+ aParentID +" " + aKeyCode;
     maStream.WriteLine(OUStringToOString(aContent, RTL_TEXTENCODING_UTF8));
 }
 


More information about the Libreoffice-commits mailing list