diff options
author | Ahmed ElShreif <aelshreif7@gmail.com> | 2019-08-03 11:51:11 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2019-08-19 22:56:38 +0800 |
commit | d13252673b05942194971f83f6612c45848901fd (patch) | |
tree | 145f6d9471b8707c9a0e8c32a1c7c0a79920c8d6 /sd | |
parent | be85e2d1d78aba2a0554645acbbacacf200f1bb4 (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
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/model/SlideSorterModel.cxx | 23 |
2 files changed, 31 insertions, 4 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; } |