diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2019-08-19 01:30:26 +0800 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2019-08-19 22:56:40 +0800 |
commit | 739c370522df4d48898b924e3c29957054f71a78 (patch) | |
tree | 58d2dc1ff49f8638198ccebec28d58cfe3db70fa /sc | |
parent | 147ae53b68844aa1b088926931f958e30888ffda (diff) |
uitest: pass OUString by const reference and formatting fixes
Change-Id: I55eca745a84998c74e2d925ed53af20382d98289
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/document.cxx | 31 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 10 |
5 files changed, 39 insertions, 35 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index fd996eb3d4cb..841cb3574213 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -109,21 +109,6 @@ 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; @@ -145,6 +130,18 @@ std::pair<SCTAB,SCTAB> getMarkedTableRange(const std::vector<ScTableUniquePtr>& return std::pair<SCTAB,SCTAB>(nTabStart,nTabEnd); } +void collectUIInformation(const std::map<OUString, OUString>& aParameters, const OUString& rAction) +{ + EventDescription aDescription; + aDescription.aID = "grid_window"; + aDescription.aAction = rAction; + aDescription.aParameters = aParameters; + aDescription.aParent = "MainWindow"; + aDescription.aKeyWord = "ScGridWinUIObject"; + + UITestLogger::getInstance().logEvent(aDescription); +} + } struct ScDefaultAttr @@ -913,7 +910,9 @@ bool ScDocument::RenameTab( SCTAB nTab, const OUString& rName, bool bExternalDoc } } } - collectUIInformation({{"NewName",rName}},"Rename_Sheet"); + + collectUIInformation({{"NewName", rName}}, "Rename_Sheet"); + return bValid; } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 56865508373a..e15ca40404d6 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -91,11 +91,11 @@ void lcl_LOKRemoveWindow(ScTabViewShell* pTabViewShell, ScSplitPos eWhich) namespace { -void collectUIInformation(const std::map<OUString, OUString>& aParameters,const OUString action) +void collectUIInformation(const std::map<OUString, OUString>& aParameters, const OUString& rAction) { EventDescription aDescription; aDescription.aID = "grid_window"; - aDescription.aAction = action; + aDescription.aAction = rAction; aDescription.aParameters = aParameters; aDescription.aParent = "MainWindow"; aDescription.aKeyWord = "ScGridWinUIObject"; @@ -857,7 +857,8 @@ void ScViewData::InsertTab( SCTAB nTab ) UpdateCurrentTab(); mpMarkData->InsertTab( nTab ); - collectUIInformation({{}},"InsertTab"); + + collectUIInformation({{}}, "InsertTab"); } void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets ) diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 831e4c7dd8ee..ac926e722bb5 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -94,11 +94,11 @@ using ::editeng::SvxBorderLine; namespace { -void collectUIInformation(const std::map<OUString, OUString>& aParameters,const OUString action) +void collectUIInformation(const std::map<OUString, OUString>& aParameters, const OUString& rAction) { EventDescription aDescription; aDescription.aID = "grid_window"; - aDescription.aAction = action; + aDescription.aAction = rAction; aDescription.aParameters = aParameters; aDescription.aParent = "MainWindow"; aDescription.aKeyWord = "ScGridWinUIObject"; @@ -1227,11 +1227,14 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bCenter ) pDocSh->UpdateOle(&GetViewData()); UpdateInputLine(); + + OUString aStartAddress = aMarkRange.aStart.GetColRowString(); + OUString aEndAddress = aMarkRange.aEnd.GetColRowString(); + + collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "MERGE_CELLS"); } } - OUString aStartAddress = aMarkRange.aStart.GetColRowString(); - OUString aEndAddress = aMarkRange.aEnd.GetColRowString(); - collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"MERGE_CELLS"); + return bOk; } @@ -1318,8 +1321,8 @@ bool ScViewFunc::RemoveMerge() pDocSh->UpdateOle(&GetViewData()); } - OUString Cell_location = aRange.aStart.GetColRowString(); - collectUIInformation({{"CELL", Cell_location }},"UNMERGE_CELL"); + OUString aCellLocation = aRange.aStart.GetColRowString(); + collectUIInformation({{"CELL", aCellLocation}}, "UNMERGE_CELL"); return true; //! bOk ?? } diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index b43debda5e7e..e39cdd488fac 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -66,7 +66,7 @@ using namespace com::sun::star; namespace { -void collectUIInformation(const std::map<OUString, OUString>& aParameters,OUString action) +void collectUIInformation(const std::map<OUString, OUString>& aParameters, const OUString& action) { EventDescription aDescription; aDescription.aID = "grid_window"; @@ -153,7 +153,8 @@ void ScViewFunc::CutToClip() OUString aStartAddress = aRange.aStart.GetColRowString(); OUString aEndAddress = aRange.aEnd.GetColRowString(); - collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"CUT"); + + collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "CUT"); } else ErrorMessage( STR_NOMULTISELECT ); @@ -188,7 +189,7 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, bool bCut, bool bApi, bool bI if( !bCut ){ OUString aStartAddress = aRange.aStart.GetColRowString(); OUString aEndAddress = aRange.aEnd.GetColRowString(); - collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"COPY"); + collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "COPY"); } return bDone; } @@ -1465,7 +1466,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, } OUString aStartAddress = aMarkRange.aStart.GetColRowString(); OUString aEndAddress = aMarkRange.aEnd.GetColRowString(); - collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"PASTE"); + collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "PASTE"); return true; } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 13c8bd708812..ad9f4a61cd05 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -101,11 +101,11 @@ ScViewFunc::~ScViewFunc() namespace { -void collectUIInformation(const std::map<OUString, OUString>& aParameters,const OUString action) +void collectUIInformation(const std::map<OUString, OUString>& aParameters, const OUString& rAction) { EventDescription aDescription; aDescription.aID = "grid_window"; - aDescription.aAction = action; + aDescription.aAction = rAction; aDescription.aParameters = aParameters; aDescription.aParent = "MainWindow"; aDescription.aKeyWord = "ScGridWinUIObject"; @@ -1636,7 +1636,7 @@ bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste ) } OUString aStartAddress = aRange.aStart.GetColRowString(); OUString aEndAddress = aRange.aEnd.GetColRowString(); - collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"INSERT_CELLS"); + collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "INSERT_CELLS"); return bSuccess; } else @@ -1724,7 +1724,7 @@ void ScViewFunc::DeleteCells( DelCellCmd eCmd ) OUString aStartAddress = aRange.aStart.GetColRowString(); OUString aEndAddress = aRange.aEnd.GetColRowString(); - collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"DELETE_CELLS"); + collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "DELETE_CELLS"); Unmark(); } @@ -2005,7 +2005,7 @@ void ScViewFunc::DeleteContents( InsertDeleteFlags nFlags ) } OUString aStartAddress = aMarkRange.aStart.GetColRowString(); OUString aEndAddress = aMarkRange.aEnd.GetColRowString(); - collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}},"DELETE"); + collectUIInformation({{"RANGE", aStartAddress + ":" + aEndAddress}}, "DELETE"); } // column width/row height (via header) - undo OK |