[Libreoffice-commits] core.git: Branch 'private/EL-SHREIF/ui_logger' - sc/source uitest/ui_logger_dsl vcl/source

Ahmed ElShreif (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 5 01:53:03 UTC 2019


 sc/source/core/data/document.cxx         |   19 +++++++++++++++++++
 sc/source/ui/view/viewdata.cxx           |   19 +++++++++++++++++++
 uitest/ui_logger_dsl/Special_commands.tx |    9 ++++++++-
 uitest/ui_logger_dsl/dsl_core.py         |    2 ++
 vcl/source/uitest/logger.cxx             |    7 +++++++
 5 files changed, 55 insertions(+), 1 deletion(-)

New commits:
commit 46160bebb756077de2408370de817f33d72cc1ad
Author:     Ahmed ElShreif <aelshreif7 at gmail.com>
AuthorDate: Sun Aug 4 13:42:09 2019 -0500
Commit:     Ahmed ElShreif <aelshreif7 at gmail.com>
CommitDate: Sun Aug 4 13:53:57 2019 -0500

    Log More Events in Calc:
    
            1) Rename Tab
            2) Insert Tab
    
    Change-Id: I7a653a4b274c0c8058672c5b0aa1645bb5a51e3a

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 106ca902534e..d0a6043c7565 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -94,6 +94,9 @@
 #include <comphelper/lok.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
+#include <vcl/uitest/logger.hxx>
+#include <vcl/uitest/eventdescription.hxx>
+
 #include <mtvelements.hxx>
 
 using ::editeng::SvxBorderLine;
@@ -106,6 +109,21 @@ using ::std::set;
 
 namespace {
 
+void collectUIInformation(const std::map<OUString, OUString>& aParameters,const OUString action)
+{
+    EventDescription aDescription;
+    aDescription.aID = "grid_window";
+    aDescription.aAction = action;
+    aDescription.aParameters = aParameters;
+    aDescription.aParent = "MainWindow";
+    aDescription.aKeyWord = "ScGridWinUIObject";
+
+    UITestLogger::getInstance().logEvent(aDescription);
+}
+}
+
+namespace {
+
 std::pair<SCTAB,SCTAB> getMarkedTableRange(const std::vector<ScTableUniquePtr>& rTables, const ScMarkData& rMark)
 {
     SCTAB nTabStart = MAXTAB;
@@ -895,6 +913,7 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool bExternalDoc
             }
         }
     }
+    collectUIInformation({{"NewName",rName}},"Rename_Sheet");
     return bValid;
 }
 
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index d0c5f0e66d2f..d5b80a363cb9 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -66,6 +66,9 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
 
+#include <vcl/uitest/logger.hxx>
+#include <vcl/uitest/eventdescription.hxx>
+
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/document/NamedPropertyValues.hpp>
 
@@ -92,6 +95,21 @@ void lcl_LOKRemoveWindow(ScTabViewShell* pTabViewShell, ScSplitPos eWhich)
 
 } // anonymous namespace
 
+namespace {
+
+void collectUIInformation(const std::map<OUString, OUString>& aParameters,const OUString action)
+{
+    EventDescription aDescription;
+    aDescription.aID = "grid_window";
+    aDescription.aAction = action;
+    aDescription.aParameters = aParameters;
+    aDescription.aParent = "MainWindow";
+    aDescription.aKeyWord = "ScGridWinUIObject";
+
+    UITestLogger::getInstance().logEvent(aDescription);
+}
+}
+
 const ScPositionHelper::index_type ScPositionHelper::null; // definition
 
 bool ScPositionHelper::Comp::operator() (const value_type& rValue1, const value_type& rValue2) const
@@ -846,6 +864,7 @@ void ScViewData::InsertTab( SCTAB nTab )
 
     UpdateCurrentTab();
     mpMarkData->InsertTab( nTab );
+    collectUIInformation({{}},"InsertTab");
 }
 
 void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets )
diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx
index 335b6d24e7d3..a4bf1a697504 100644
--- a/uitest/ui_logger_dsl/Special_commands.tx
+++ b/uitest/ui_logger_dsl/Special_commands.tx
@@ -74,7 +74,8 @@ writer_Insert_BreakPage:
 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_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
@@ -118,6 +119,12 @@ calc_Merge_Cells:
 calc_UNMerge_Cells:
     'Delete the merge between' '{' '"CELL":' input_range=STRING '}'
 ;
+calc_Rename_Sheet:
+    'Rename The Selected Tab to ' new_name=STRING
+;
+calc_Insert_sheet:
+    'Insert New Tab '
+;
 //this is the select options
 select_options:
     one_cell | range_of_cells
diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py
index 1eaa33a441cd..827f2ca45b20 100644
--- a/uitest/ui_logger_dsl/dsl_core.py
+++ b/uitest/ui_logger_dsl/dsl_core.py
@@ -101,6 +101,8 @@ class ul_Compiler:
             'calc_Copy_Cells':self.do_nothing,
             'calc_Merge_Cells':self.do_nothing,
             'calc_UNMerge_Cells':self.do_nothing,
+            'calc_Rename_Sheet':self.do_nothing,
+            'calc_Insert_sheet':self.do_nothing,
             'impress_Insert_Slide':self.do_nothing,
             'impress_Delete_Page':self.do_nothing,
             'impress_Duplicate_Slide':self.do_nothing,
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index d2bcab4b6726..eafcef0a2997 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -369,6 +369,13 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
         else if(rDescription.aAction=="UNMERGE_CELL"){
             aLogLine = "Delete the merged " + aParameterString;
         }
+        else if(rDescription.aAction=="Rename_Sheet"){
+            aLogLine = "Rename The Selected Tab to \""+\
+            GetValueInMapWithIndex(rDescription.aParameters,0)+"\"";
+        }
+        else if(rDescription.aAction=="InsertTab"){
+            aLogLine = "Insert New Tab ";
+        }
     }
     else if(rDescription.aID=="impress_win_or_draw_win"){
         if(rDescription.aAction=="Insert_New_Page_or_Slide"){


More information about the Libreoffice-commits mailing list