uitest/ui_logger_dsl/UI_Object_commands.tx |   24 +++++++++++++-----------
 vcl/source/control/ivctrl.cxx              |    5 ++---
 vcl/source/uitest/logger.cxx               |    2 +-
 3 files changed, 16 insertions(+), 15 deletions(-)

New commits:
commit bcc83732f906bb7e89f8d67e4817fe0f4bf09b0e
Author:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
AuthorDate: Thu Feb 17 18:25:20 2022 +0200
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Sat Feb 19 08:03:31 2022 +0100

    uilogger: make vertical tab handling more robust
    
    For example hyperlink dialog does not have numeric ids for tabs.
    Now the rule matches both integers and "common identifiers" as per
    https://textx.github.io/textX/stable/grammar/#textx-base-types
    
    Parent argument was removed as it does not seem to be used and
    it was empty in the case of the hyperlink dialog, causing the DSL
    parser to fail.
    
    More work is needed as self.xUITest.getTopFocusWindow() in a
    hyperlink dialog opening test does not contain the child "tabcontrol"
    and thus it errors out.
    
    Change-Id: I1637f7300884881ee4d869e8f04700e56935f2d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130111
    Tested-by: Jenkins
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/uitest/ui_logger_dsl/UI_Object_commands.tx 
b/uitest/ui_logger_dsl/UI_Object_commands.tx
index 04f975a39066..f3d5d42903e5 100644
--- a/uitest/ui_logger_dsl/UI_Object_commands.tx
+++ b/uitest/ui_logger_dsl/UI_Object_commands.tx
@@ -1,7 +1,7 @@
 import type_options
 
 /*
-    this file is for The Grammar of: 
+    this file is for The Grammar of:
         1)  ButtonUIObject : ( Click event )
         2)  EditUIObject       : ( Type event - Clear event - Select Text 
event )
         3)  CheckBoxUIObject   : ( Toggle the value  )
@@ -16,26 +16,28 @@ import type_options
 */
 
 UIObjectCommand:
-  ButtonUIObject | CheckBoxUIObject | EditUIObject | 
-  RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject | 
+  ButtonUIObject | CheckBoxUIObject | EditUIObject |
+  RadioButtonUIObject | ListBoxUIObject | ComboBoxUIObject |
   SpinFieldUIObject | TabControlUIObject | ToolBoxUIObject |
   ValueSetUIObject | MenuBtnUIObject
 ;
-
+TabPageNumber:
+  INT | ID
+;
 ButtonUIObject:
   'Click on' ui_button=STRING  ('from' parent_id=ID)?
-;      
+;
 CheckBoxUIObject:
-  'Toggle' Check_box_id=STRING 'CheckBox' ('from' parent_id=ID)?   
-;      
+  'Toggle' Check_box_id=STRING 'CheckBox' ('from' parent_id=ID)?
+;
 RadioButtonUIObject:
-  'Select' Radio_button_id=STRING 'RadioButton' ('from' parent_id=ID)? 
-;      
+  'Select' Radio_button_id=STRING 'RadioButton' ('from' parent_id=ID)?
+;
 ComboBoxUIObject:
-   'Select in' Combo_box_id=STRING 'ComboBox' 'item number' item_num=INT 
('from' parent_id=ID)?  
+   'Select in' Combo_box_id=STRING 'ComboBox' 'item number' item_num=INT 
('from' parent_id=ID)?
 ;
 TabControlUIObject:
-   'Choose Tab number' tab_page_number=INT 'in' tab_id=STRING ('from' 
parent_id=ID)? 
+   'Choose Tab number' tab_page_number=TabPageNumber 'in' tab_id=STRING 
('from' parent_id=ID)?
 ;
 EditUIObject:
    action=action_on_UIObject ('from' parent_id=ID)?
diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index dc55deed29d4..54b64373cde0 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -36,13 +36,12 @@ using namespace ::com::sun::star::accessibility;
 
 namespace
 {
-void collectUIInformation( const OUString& aID, const OUString& aPos , const 
OUString& aParent )
+void collectUIInformation( const OUString& aID, const OUString& aPos)
 {
     EventDescription aDescription;
     aDescription.aID = aID;
     aDescription.aParameters = {{ "POS" ,  aPos}};
     aDescription.aAction = "SELECT";
-    aDescription.aParent = aParent;
     aDescription.aKeyWord = "VerticalTab";
     UITestLogger::getInstance().logEvent(aDescription);
 }
@@ -544,7 +543,7 @@ void VerticalTabControl::SetCurPageId(const OString& rId)
         ActivatePage();
         pNewData->xPage->Show();
     }
-    
collectUIInformation(get_id(),OStringToOUString(m_sCurrentPageId,RTL_TEXTENCODING_UTF8),
 GetPageParent()->get_id());
+    
collectUIInformation(get_id(),OStringToOUString(m_sCurrentPageId,RTL_TEXTENCODING_UTF8));
 }
 
 const OString & VerticalTabControl::GetPageId(sal_uInt16 nIndex) const
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 4eef2ee0ebb1..29520fd61331 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -598,7 +598,7 @@ void UITestLogger::logEvent(const EventDescription& 
rDescription)
     else if (rDescription.aKeyWord == "VerticalTab")
     {
         aLogLine = "Choose Tab number " + 
GetValueInMapWithIndex(rDescription.aParameters, 0)
-                   + " in '" + rDescription.aID + "' from " + 
rDescription.aParent;
+                   + " in '" + rDescription.aID + "'";
     }
     else
     {

Reply via email to