diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-03 09:36:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-03 10:29:57 +0200 |
commit | 101a9b4a3fcf1fd0a7163dac3a5dcd69431f4fee (patch) | |
tree | 29039a491e9ca058bd3ea9114bf8889ce8089ebc /sw | |
parent | 55220e7bc6576a7575c675ba425e757a3aefa243 (diff) |
loplugin:constantparam
Change-Id: I9cdd15185cfa8347a08402da956eab7cbdd63de6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91609
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/uibase/shells/shells.cxx | 11 | ||||
-rw-r--r-- | sw/source/uibase/inc/navipi.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navipi.cxx | 11 |
4 files changed, 9 insertions, 17 deletions
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx index ee39b563cfc9..c1012d6af1d1 100644 --- a/sw/qa/uibase/shells/shells.cxx +++ b/sw/qa/uibase/shells/shells.cxx @@ -26,21 +26,16 @@ #include <IDocumentDrawModelAccess.hxx> #include <drawdoc.hxx> -static char const DATA_DIRECTORY[] = "/sw/qa/uibase/shells/data/"; - /// Covers sw/source/uibase/shells/ fixes. class SwUibaseShellsTest : public SwModelTestBase { public: - SwDoc* createDoc(const char* pName = nullptr); + SwDoc* createDoc(); }; -SwDoc* SwUibaseShellsTest::createDoc(const char* pName) +SwDoc* SwUibaseShellsTest::createDoc() { - if (!pName) - loadURL("private:factory/swriter", nullptr); - else - load(DATA_DIRECTORY, pName); + loadURL("private:factory/swriter", nullptr); SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); CPPUNIT_ASSERT(pTextDoc); diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx index 1ae6542fb51b..8c2c210df969 100644 --- a/sw/source/uibase/inc/navipi.hxx +++ b/sw/source/uibase/inc/navipi.hxx @@ -130,7 +130,7 @@ public: virtual void dispose() override; void UpdateListBox(); - void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget, bool bWithCilds); + void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget); virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index febda121a810..54f3c6e94caf 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -3028,7 +3028,7 @@ void SwContentTree::MoveOutline(SwOutlineNodes::size_type nTargetPos) nTargetPos = nPrevTargetPosOrOffset; } } - GetParentWindow()->MoveOutline(nSourcePos, nTargetPos, true); + GetParentWindow()->MoveOutline(nSourcePos, nTargetPos); } pShell->EndUndo(); diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index ca52eeb8cc5f..2a0d30610c26 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -86,8 +86,7 @@ OUString SwNavigationPI::CleanEntry(const OUString& rEntry) // Execution of the drag operation with and without the children. -void SwNavigationPI::MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget, - bool bWithChildren) +void SwNavigationPI::MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget) { SwView *pView = GetCreateView(); SwWrtShell &rSh = pView->GetWrtShell(); @@ -98,18 +97,16 @@ void SwNavigationPI::MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNod SwOutlineNodes::difference_type nMove = nTarget-nSource; //( nDir<0 ) ? 1 : 0 ; rSh.GotoOutline(nSource); - if (bWithChildren) - rSh.MakeOutlineSel(nSource, nSource, true); + rSh.MakeOutlineSel(nSource, nSource, true); // While moving, the selected children does not counting. const SwOutlineNodes::size_type nLastOutlinePos = rSh.GetOutlinePos(MAXLEVEL); - if(bWithChildren && nMove > 1 && - nLastOutlinePos < nTarget) + if(nMove > 1 && nLastOutlinePos < nTarget) { if(!rSh.IsCursorPtAtEnd()) rSh.SwapPam(); nMove -= nLastOutlinePos - nSource; } - if(!bWithChildren || nMove < 1 || nLastOutlinePos < nTarget ) + if( nMove < 1 || nLastOutlinePos < nTarget ) rSh.MoveOutlinePara( nMove ); rSh.ClearMark(); rSh.GotoOutline( nSource + nMove); |