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

Ahmed ElShreif (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 21 21:07:01 UTC 2020


 sc/source/ui/view/gridwin.cxx            |    7 ++++---
 uitest/ui_logger_dsl/Special_commands.tx |   26 +++++++++++++++-----------
 uitest/ui_logger_dsl/dsl_core.py         |   20 ++++++++++++++++++++
 vcl/source/uitest/logger.cxx             |    7 +++++--
 4 files changed, 44 insertions(+), 16 deletions(-)

New commits:
commit ea94295b70b5e9703a54645e73aeda2eba7297fa
Author:     Ahmed ElShreif <aelshreif7 at gmail.com>
AuthorDate: Tue Aug 18 21:57:45 2020 +0200
Commit:     Ahmed ElShreif <aelshreif7 at gmail.com>
CommitDate: Fri Aug 21 23:06:22 2020 +0200

    uilogger : Add support in the Logger and DSL for the LAUNCHMENU in CALC
    
    The support is tested on some random test cases.
    
    For example the DSL syntax will be:
            >>"Launch SELECTMENU from Col 3 and Row 5"
    
    Change-Id: Ic5b29ad8b377eed5c38aa1d0f680cbfb979763e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100958
    Tested-by: Jenkins
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 887903286ca3..296873a2ef76 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -630,12 +630,12 @@ public:
     }
 };
 
-void collectUIInformation(const OUString& aRow, const OUString& aCol)
+void collectUIInformation(const OUString& aRow, const OUString& aCol , const OUString& aevent)
 {
     EventDescription aDescription;
     aDescription.aAction = "LAUNCH";
     aDescription.aID = "grid_window";
-    aDescription.aParameters = {{"AUTOFILTER", ""},
+    aDescription.aParameters = {{aevent, ""},
         {"ROW", aRow}, {"COL", aCol}};
     aDescription.aParent = "MainWindow";
     aDescription.aKeyWord = "ScGridWinUIObject";
@@ -751,7 +751,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
     // remember filter rules before modification
     rControl.getResult(aSaveAutoFilterResult);
 
-    collectUIInformation(OUString::number(nRow), OUString::number(nCol));
+    collectUIInformation(OUString::number(nRow), OUString::number(nCol),"AUTOFILTER");
 }
 
 void ScGridWindow::RefreshAutoFilterButton(const ScAddress& rPos)
@@ -1222,6 +1222,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow )
 
         mpFilterBox->EndInit();
     }
+    collectUIInformation(OUString::number(nRow), OUString::number(nCol),"SELECTMENU");
 }
 
 void ScGridWindow::FilterSelect( sal_uLong nSel )
diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx
index 071cfb9dcbbb..601a600f4bdb 100644
--- a/uitest/ui_logger_dsl/Special_commands.tx
+++ b/uitest/ui_logger_dsl/Special_commands.tx
@@ -60,22 +60,23 @@ writer_Insert_BreakPage:
     1)  select sheet
     2)  Select cell or range
     3)  launch AutoFill
-    4)  Delete Cells
-    5)  Remove Content of a cell
-    6)  Insert new Cells
-    7)  Cut Cells
-    8)  Copy Cells
-    9)  Paste Cells
-    10) Merge Cells
-    11) Unmerge Cells
+    4)  launch SELECTMENU
+    5)  Delete Cells
+    6)  Remove Content of a cell
+    7)  Insert new Cells
+    8)  Cut Cells
+    9)  Copy Cells
+    10)  Paste Cells
+    11) Merge Cells
+    12) Unmerge Cells
 
   then we can add whatever we need in the future
 */
 calc_command:
   calc_Type_command | calc_switch_sheet | calc_Select_cell | calc_AutoFill_filter |
-  calc_Delete_Cells | calc_Remove_Content | calc_insert_cells | calc_Cut_Cells | 
-  calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | calc_Merge_Cells |
-  calc_Rename_Sheet | calc_Insert_sheet
+  calc_SelectMenu_filter | calc_Delete_Cells | calc_Remove_Content | calc_insert_cells |
+  calc_Cut_Cells | calc_Copy_Cells | calc_Paste_Cells | calc_UNMerge_Cells | 
+  calc_Merge_Cells | calc_Rename_Sheet | calc_Insert_sheet
 ;
 calc_Type_command:
   'Type on current cell' what_to_type=Type_options
@@ -89,6 +90,9 @@ calc_Select_cell:
 calc_AutoFill_filter:
   'Launch AutoFilter from Col' col_num=INT 'and Row' row_num=INT
 ;
+calc_SelectMenu_filter:
+  'Launch SELECTMENU from Col' col_num=INT 'and Row' row_num=INT
+;
 range_of_cells:
     '{' '"RANGE":' input_range=STRING '}'
 ;
diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py
index 644fc06e73dd..ebe936bba76a 100644
--- a/uitest/ui_logger_dsl/dsl_core.py
+++ b/uitest/ui_logger_dsl/dsl_core.py
@@ -110,6 +110,7 @@ class ul_Compiler:
                 "calc_switch_sheet": self.handle_calc_switch_sheet,
                 "calc_Type_command": self.handle_calc_Type_command,
                 "calc_AutoFill_filter": self.handle_calc_AutoFill_filter,
+                "calc_SelectMenu_filter": self.handle_calc_SelectMenu_filter,
                 "impress_Type_command": self.handle_impress_Type_command,
                 "math_element_selector": self.handle_math_element_selector,
                 "math_Type_command": self.handle_math_Type_command,
@@ -726,6 +727,25 @@ class ul_Compiler:
         self.variables.append(line)
         self.prev_command = calc_AutoFill_filter
 
+    def handle_calc_SelectMenu_filter(self, calc_SelectMenu_filter):
+
+        self.init_app()
+
+        line = (
+            double_tab
+            + self.current_app
+            + '.executeAction("LAUNCH", mkPropertyValues'
+            + '({"SELECTMENU": "", "COL": "'
+            + str(calc_SelectMenu_filter.col_num)
+            + '"'
+            + ', "ROW": "'
+            + str(calc_SelectMenu_filter.row_num)
+            + '"}))\n'
+        )
+
+        self.variables.append(line)
+        self.prev_command = calc_SelectMenu_filter
+
     def handle_impress_Type_command(self, impress_Type_command):
 
         self.init_app()
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index 93edcc14ddfe..8cd0c4b6f15f 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -430,8 +430,11 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
         }
         else if (rDescription.aAction == "LAUNCH")
         {
-            aLogLine = "Launch AutoFilter from Col "
-                       + GetValueInMapWithIndex(rDescription.aParameters, 2) + " and Row "
+            aLogLine = "Launch"
+                       + GetKeyInMapWithIndex(rDescription.aParameters, 2)
+                       + " from Col "
+                       + GetValueInMapWithIndex(rDescription.aParameters, 2)
+                       + " and Row "
                        + GetValueInMapWithIndex(rDescription.aParameters, 1);
         }
         else if (rDescription.aAction == "DELETE_CONTENT")


More information about the Libreoffice-commits mailing list