diff options
author | Saurav Chirania <saurav.chir@gmail.com> | 2018-07-13 01:13:11 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2018-07-31 00:35:42 +0200 |
commit | 7e65a0794b7c57210779bb9a6d1f2b2e49eb86e9 (patch) | |
tree | b15fe5aa2c79b8c1f1cbba28b1be2acbde025ce0 /sw | |
parent | 051399740e41c6495ed362e78c63e0868bcd180c (diff) |
uitest logger: log more events
Logging for the following:
1) Object Selection
2) Sidebar / Deck opening
3) Parameters of UNO commands
4) Element Selection (Math)
5) Set Zoom (Impress)
6) Calc -
a) Autofilter Launch
b) Select Cell / Range of cells
c) Switch table
7) Writer -
a) Goto page
b) Set Zoom
Change-Id: Ifc7f603f62d10cfd1062923ded68203e574aebb6
Reviewed-on: https://gerrit.libreoffice.org/57368
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 19 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewmdi.cxx | 20 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/select.cxx | 23 |
3 files changed, 62 insertions, 0 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index ccb5ffc84ccf..9ad23eb7a3ca 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -68,6 +68,8 @@ #include <editeng/editview.hxx> #include <PostItMgr.hxx> #include <DocumentSettingManager.hxx> +#include <vcl/uitest/logger.hxx> +#include <vcl/uitest/eventdescription.hxx> using namespace com::sun::star; using namespace util; @@ -1067,6 +1069,21 @@ bool SwCursorShell::SetInFrontOfLabel( bool bNew ) return false; } +namespace { + +void collectUIInformation(const OUString& aPage) +{ + EventDescription aDescription; + aDescription.aAction = "GOTO"; + aDescription.aParameters = {{"PAGE", aPage}}; + aDescription.aID = "writer_edit"; + aDescription.aKeyWord = "SwEditWinUIObject"; + aDescription.aParent = "MainWindow"; + UITestLogger::getInstance().logEvent(aDescription); +} + +} + bool SwCursorShell::GotoPage( sal_uInt16 nPage ) { SET_CURR_SHELL( this ); @@ -1077,6 +1094,8 @@ bool SwCursorShell::GotoPage( sal_uInt16 nPage ) SwCursorSelOverFlags::ChangePos ); if( bRet ) UpdateCursor(SwCursorShell::SCROLLWIN|SwCursorShell::CHKRANGE|SwCursorShell::READONLY); + + collectUIInformation(OUString::number(nPage)); return bRet; } diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index b3ac8c5b152b..11ee243edcd5 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -53,11 +53,29 @@ #include <svx/srchdlg.hxx> +#include <vcl/uitest/logger.hxx> +#include <vcl/uitest/eventdescription.hxx> + sal_uInt16 SwView::m_nMoveType = NID_PGE; sal_Int32 SwView::m_nActMark = 0; using namespace ::com::sun::star::uno; +namespace { + +void collectUIInformation(const OUString& aFactor) +{ + EventDescription aDescription; + aDescription.aID = "writer_edit"; + aDescription.aParameters = {{"ZOOM", aFactor}}; + aDescription.aAction = "SET"; + aDescription.aKeyWord = "SwEditWinUIObject"; + aDescription.aParent = "MainWindow"; + UITestLogger::getInstance().logEvent(aDescription); +} + +} + void SwView::SetZoom( SvxZoomType eZoomType, short nFactor, bool bViewOnly ) { bool const bCursorIsVisible(m_pWrtShell->IsCursorVisible()); @@ -65,6 +83,8 @@ void SwView::SetZoom( SvxZoomType eZoomType, short nFactor, bool bViewOnly ) // fdo#40465 force the cursor to stay in view whilst zooming if (bCursorIsVisible) m_pWrtShell->ShowCursor(); + + collectUIInformation(OUString::number(nFactor)); } void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index f12005e5cbab..3f4c2540f006 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -40,6 +40,8 @@ #include <doc.hxx> #include <wordcountdialog.hxx> #include <memory> +#include <vcl/uitest/logger.hxx> +#include <vcl/uitest/eventdescription.hxx> namespace com { namespace sun { namespace star { namespace util { struct SearchOptions2; @@ -388,6 +390,25 @@ void SwWrtShell::SttSelect() SwTransferable::CreateSelection( *this ); } +namespace { + +void collectUIInformation(SwShellCursor* pCursor) +{ + EventDescription aDescription; + OUString aSelStart = OUString::number(pCursor->Start()->nContent.GetIndex()); + OUString aSelEnd = OUString::number(pCursor->End()->nContent.GetIndex()); + + aDescription.aParameters = {{"START_POS", aSelStart}, {"END_POS", aSelEnd}}; + aDescription.aAction = "SELECT"; + aDescription.aID = "writer_edit"; + aDescription.aKeyWord = "SwEditWinUIObject"; + aDescription.aParent = "MainWindow"; + + UITestLogger::getInstance().logEvent(aDescription); +} + +} + // End of a selection process. void SwWrtShell::EndSelect() @@ -409,6 +430,8 @@ void SwWrtShell::EndSelect() SwWordCountWrapper *pWrdCnt = static_cast<SwWordCountWrapper*>(GetView().GetViewFrame()->GetChildWindow(SwWordCountWrapper::GetChildWindowId())); if (pWrdCnt) pWrdCnt->UpdateCounts(); + + collectUIInformation(GetCursor_()); } void SwWrtShell::ExtSelWrd(const Point *pPt, bool ) |