summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmed ElShreif <aelshreif7@gmail.com>2019-08-03 11:51:11 -0500
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2019-08-19 22:56:38 +0800
commitd13252673b05942194971f83f6612c45848901fd (patch)
tree145f6d9471b8707c9a0e8c32a1c7c0a79920c8d6
parentbe85e2d1d78aba2a0554645acbbacacf200f1bb4 (diff)
uitest: log more events
Impress: 1) Delete Slide 2) Duplicate Slide 3) Rename Slide Draw: 1) Delte Page 2) Rename Page Change-Id: I124bdf96c58dfe00bdb039c5e93afc0dc6e7163d
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx12
-rw-r--r--sd/source/ui/slidesorter/model/SlideSorterModel.cxx23
-rw-r--r--uitest/ui_logger_dsl/Special_commands.tx28
-rw-r--r--uitest/ui_logger_dsl/dsl_core.py5
-rw-r--r--vcl/source/uitest/logger.cxx21
5 files changed, 82 insertions, 7 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index adcc0da4ad82..a97ccb7d0588 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -113,11 +113,11 @@ SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet);
namespace {
-void collectUIInformation(const OUString& num,const OUString& action)
+void collectUIInformation(const std::map<OUString, OUString>& aParameters,const OUString& action)
{
EventDescription aDescription;
aDescription.aID = "impress_win_or_draw_win";
- aDescription.aParameters = {{"POS", num}};
+ aDescription.aParameters = aParameters;
aDescription.aAction = action;
aDescription.aKeyWord = "ImpressWindowUIObject";
aDescription.aParent = "MainWindow";
@@ -918,6 +918,8 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest)
ScopedVclPtr<AbstractSvxNameDialog> aNameDlg(pFact->CreateSvxNameDialog(
pWin ? pWin->GetFrameWeld() : nullptr,
aPageName, aDescr));
+ OUString aOldName;
+ aNameDlg->GetName( aOldName );
aNameDlg->SetText( aTitle );
aNameDlg->SetCheckNameHdl( LINK( this, SlotManager, RenameSlideHdl ), true );
aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE );
@@ -934,6 +936,9 @@ void SlotManager::RenameSlide(const SfxRequest& rRequest)
DBG_ASSERT( bResult, "Couldn't rename slide" );
}
}
+ OUString aNewName;
+ aNameDlg->GetName( aNewName );
+ collectUIInformation({{"OldName",aOldName},{"NewName",aNewName}},"RENAME");
aNameDlg.disposeAndClear();
}
// Tell the slide sorter about the name change (necessary for
@@ -1100,7 +1105,7 @@ void SlotManager::InsertSlide (SfxRequest& rRequest)
PageSelector::UpdateLock aUpdateLock (mrSlideSorter);
mrSlideSorter.GetController().GetPageSelector().DeselectAllPages();
mrSlideSorter.GetController().GetPageSelector().SelectPage(pNewPage);
- collectUIInformation(OUString::number(nInsertionIndex+2),"Insert_New_Page_or_Slide");
+ collectUIInformation({{"POS", OUString::number(nInsertionIndex+2)}},"Insert_New_Page_or_Slide");
}
void SlotManager::DuplicateSelectedSlides (SfxRequest& rRequest)
@@ -1147,6 +1152,7 @@ void SlotManager::DuplicateSelectedSlides (SfxRequest& rRequest)
{
rSelector.SelectPage(it);
}
+ collectUIInformation({{"POS", OUString::number(nInsertPosition+2)}},"Duplicate");
}
void SlotManager::ChangeSlideExclusionState (
diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
index 94e70833c4c6..7811c3b08e68 100644
--- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
+++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx
@@ -35,6 +35,9 @@
#include <com/sun/star/beans/UnknownPropertyException.hpp>
#include <com/sun/star/frame/XController.hpp>
+#include <vcl/uitest/logger.hxx>
+#include <vcl/uitest/eventdescription.hxx>
+
#include <ViewShellBase.hxx>
#include <DrawViewShell.hxx>
#include <DrawDocShell.hxx>
@@ -101,6 +104,22 @@ namespace {
}
}
+namespace {
+
+void collectUIInformation(const OUString& num,const OUString& action)
+{
+ EventDescription aDescription;
+ aDescription.aID = "impress_win_or_draw_win";
+ aDescription.aParameters = {{"POS", num}};
+ aDescription.aAction = action;
+ aDescription.aKeyWord = "ImpressWindowUIObject";
+ aDescription.aParent = "MainWindow";
+
+ UITestLogger::getInstance().logEvent(aDescription);
+}
+
+}
+
SlideSorterModel::SlideSorterModel (SlideSorter& rSlideSorter)
: maMutex(),
mrSlideSorter(rSlideSorter),
@@ -614,7 +633,9 @@ bool SlideSorterModel::DeleteSlide (const SdPage* pPage)
maPageDescriptors.erase(iter);
UpdateIndices(nIndex);
}
-
+ if(nIndex>=0){
+ collectUIInformation(OUString::number(nIndex+1),"Delete_Slide_or_Page");
+ }
return bMarkedSelected;
}
diff --git a/uitest/ui_logger_dsl/Special_commands.tx b/uitest/ui_logger_dsl/Special_commands.tx
index 1d11067424a9..335b6d24e7d3 100644
--- a/uitest/ui_logger_dsl/Special_commands.tx
+++ b/uitest/ui_logger_dsl/Special_commands.tx
@@ -128,12 +128,16 @@ select_options:
This part for all the impress log statments:
1) Type
- 2) Insert New Page
+ 2) Insert New Slide
+ 3) Delete Slide
+ 4) Duplicate Slide
+ 5) Rename Slide
then we can add whatever we need in the future
*/
impress_command:
- impress_Type_command | impress_Insert_Slide
+ impress_Type_command | impress_Insert_Slide | impress_Delete_Page |
+ impress_Duplicate_Slide | impress_Rename_Slide
;
impress_Type_command:
'Type on impress ' what_to_type=Type_options
@@ -141,6 +145,15 @@ impress_Type_command:
impress_Insert_Slide:
'Insert New Slide at Position ' position_num=INT
;
+impress_Delete_Page:
+ 'Delete Slide number ' position_num=INT
+;
+impress_Duplicate_Slide:
+ 'Duplicate The Selected Slide '
+;
+impress_Rename_Slide:
+ 'Rename The Selected Slide from ' old_name=STRING 'to' new_name=STRING
+;
//=================================================================//
/*
This part for all the math log statments:
@@ -166,15 +179,24 @@ math_Type_command:
1) Type
2) Insert New Page
+ 3) Delete Page
+ 4) Rename Page
then we can add whatever we need in the future
*/
draw_command:
- draw_Type_command | draw_Insert_Page
+ draw_Type_command | draw_Insert_Page | draw_Delete_Page |
+ draw_Rename_Page
;
draw_Type_command:
'Type on draw ' what_to_type=Type_options
;
draw_Insert_Page:
'Insert New Page at Position ' position_num=INT
+;
+draw_Delete_Page:
+ 'Delete Page number ' position_num=INT
+;
+draw_Rename_Page:
+ 'Rename The Selected Page from ' old_name=STRING 'to' new_name=STRING
; \ No newline at end of file
diff --git a/uitest/ui_logger_dsl/dsl_core.py b/uitest/ui_logger_dsl/dsl_core.py
index 9a5f375b5aa9..1eaa33a441cd 100644
--- a/uitest/ui_logger_dsl/dsl_core.py
+++ b/uitest/ui_logger_dsl/dsl_core.py
@@ -102,7 +102,12 @@ class ul_Compiler:
'calc_Merge_Cells':self.do_nothing,
'calc_UNMerge_Cells':self.do_nothing,
'impress_Insert_Slide':self.do_nothing,
+ 'impress_Delete_Page':self.do_nothing,
+ 'impress_Duplicate_Slide':self.do_nothing,
+ 'impress_Rename_Slide':self.do_nothing,
'draw_Insert_Page':self.do_nothing,
+ 'draw_Delete_Page':self.do_nothing,
+ 'draw_Rename_Page':self.do_nothing,
})
self.log_lines=self.get_log_file(self.input_address)
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index b9b86fdc92c5..502c0a9f0244 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -379,6 +379,27 @@ void UITestLogger::logEvent(const EventDescription& rDescription)
aLogLine = "Insert New Page at Position " + GetValueInMapWithIndex(rDescription.aParameters,0);
}
}
+ else if(rDescription.aAction=="Delete_Slide_or_Page"){
+ if(UITestLogger::getInstance().getAppName()=="impress"){
+ aLogLine = "Delete Slide number "+ GetValueInMapWithIndex(rDescription.aParameters,0);
+ }
+ else if(UITestLogger::getInstance().getAppName()=="draw"){
+ aLogLine = "Delete Page number "+ GetValueInMapWithIndex(rDescription.aParameters,0);
+ }
+ }
+ else if(rDescription.aAction=="Duplicate"){
+ aLogLine = "Duplicate The Selected Slide ";
+ }
+ else if(rDescription.aAction=="RENAME"){
+ if(UITestLogger::getInstance().getAppName()=="impress"){
+ aLogLine = "Rename The Selected Slide from \""+ GetValueInMapWithIndex(rDescription.aParameters,1)+\
+ "\" to \"" + GetValueInMapWithIndex(rDescription.aParameters,0)+"\"";
+ }
+ else if(UITestLogger::getInstance().getAppName()=="draw"){
+ aLogLine = "Rename The Selected Page from \""+ GetValueInMapWithIndex(rDescription.aParameters,1)+\
+ "\" to \"" + GetValueInMapWithIndex(rDescription.aParameters,0)+"\"";
+ }
+ }
}
else if(rDescription.aParent=="element_selector"){
aLogLine ="Select element no " + rDescription.aID +