summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmed ElShreif <aelshreif7@gmail.com>2019-08-04 13:42:09 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2019-08-18 22:03:18 +0800
commitd3019d6d732e3072b0a71da05973107fc8cb5ae1 (patch)
tree1a903fcf6696afffb84fb3e1ee87790424ea8428
parentd340256bb2ac95367c68aad947a94f17a4796528 (diff)
uitest: log more events in Calc:
1) Rename Tab 2) Insert Tab Change-Id: I7a653a4b274c0c8058672c5b0aa1645bb5a51e3a
-rw-r--r--sc/source/core/data/document.cxx19
-rw-r--r--sc/source/ui/view/viewdata.cxx19
-rw-r--r--uitest/ui_logger_dsl/Special_commands.tx9
-rw-r--r--uitest/ui_logger_dsl/dsl_core.py2
-rw-r--r--vcl/source/uitest/logger.cxx7
5 files changed, 55 insertions, 1 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 3a65ae04aad7..fd996eb3d4cb 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 a87dc2dd3ed8..56865508373a 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -60,6 +60,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>
@@ -86,6 +89,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
@@ -839,6 +857,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 502c0a9f0244..36a6c7340add 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"){