diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-28 14:43:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-29 11:12:47 +0200 |
commit | 3dfc17ed6334c619228668ffeff591bc75d32025 (patch) | |
tree | b2c985c9557151e120ddb10c4cc82bda4d7835ce /sw | |
parent | f8e989c2384250d30f84651eb03673fb8d8dd096 (diff) |
loplugin:constantparam (3)
Change-Id: Ifc47bb8e096c9a8563021b2fcb44199577740746
Reviewed-on: https://gerrit.libreoffice.org/59747
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/crsrsh.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 4 |
6 files changed, 14 insertions, 22 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index e57153609256..f975533ac6e9 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -512,9 +512,9 @@ public: // false: which is visible at the upper margin. void GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, bool bAtCursorPos = true, const bool bCalcFrame = true ); - // Returns current page's sequential number (1-based), ignoring autoinserted empty pages + // Returns current page's sequential number (1-based),in which cursor is located, ignoring autoinserted empty pages. // Returns 0 on error - sal_uInt16 GetPageNumSeqNonEmpty(bool bAtCursorPos, bool bCalcFrame); + sal_uInt16 GetPageNumSeqNonEmpty(); // Determine how "empty pages" are handled // (used in PhyPage). sal_uInt16 GetNextPrevPageNum( bool bNext = true ); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 70d2819b3952..2afbfdadbd08 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1126,14 +1126,14 @@ void SwCursorShell::GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, rnVirtNum = pPg? pPg->GetVirtPageNum() : 1; } -sal_uInt16 SwCursorShell::GetPageNumSeqNonEmpty(bool bAtCursorPos, bool bCalcFrame) +sal_uInt16 SwCursorShell::GetPageNumSeqNonEmpty() { SET_CURR_SHELL(this); // page number: first visible page or the one at the cursor - const SwContentFrame* pCFrame = GetCurrFrame(bCalcFrame); + const SwContentFrame* pCFrame = GetCurrFrame(/*bCalcFrame*/true); const SwPageFrame* pPg = nullptr; - if (!bAtCursorPos || !pCFrame || nullptr == (pPg = pCFrame->FindPageFrame())) + if (!pCFrame || nullptr == (pPg = pCFrame->FindPageFrame())) { pPg = Imp()->GetFirstVisPage(GetOut()); while (pPg && pPg->IsEmptyPage()) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index e9ae6c5fd588..77101984d429 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1900,7 +1900,7 @@ void DocxAttributeOutput::DoWriteFieldRunProperties( const SwTextNode * pNode, s // 3. output all other character properties SwWW8AttrIter aAttrIt( m_rExport, *pNode ); - aAttrIt.OutAttr( nPos, false, bWriteCombChars ); + aAttrIt.OutAttr( nPos, bWriteCombChars ); // 4. explicitly write the font-properties, to ensure all runs in the field have them // see tdf#66401 diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 51fe41d0458c..5bd578015214 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -381,14 +381,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) return nMinPos; } -static bool lcl_isFontsizeItem( const SfxPoolItem& rItem ) -{ - return ( rItem.Which( ) == RES_CHRATR_FONTSIZE || - rItem.Which( ) == RES_CHRATR_CJK_FONTSIZE || - rItem.Which( ) == RES_CHRATR_CTL_FONTSIZE ); -} - -void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby , bool bWriteCombChars) +void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bWriteCombChars) { m_rExport.AttrOutput().RTLAndCJKState( mbCharIsRTL, GetScript() ); @@ -498,8 +491,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby , bool bWriteCombChars for ( const auto& aRangeItem : aRangeItems ) { - if ( !bRuby || !lcl_isFontsizeItem( *(aRangeItem.second) ) ) - aExportItems[aRangeItem.first] = aRangeItem.second; + aExportItems[aRangeItem.first] = aRangeItem.second; } if ( !aExportItems.empty() ) @@ -2471,7 +2463,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) // Output the character attributes // #i51277# do this before writing flys at end of paragraph AttrOutput().StartRunProperties(); - aAttrIter.OutAttr( nCurrentPos ); + aAttrIter.OutAttr( nCurrentPos, false ); AttrOutput().EndRunProperties( pRedlineData ); } @@ -2514,7 +2506,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) // do it after WriteCR for an empty paragraph (otherwise // WW8_WrFkp::Append throws SPRMs away...) AttrOutput().StartRunProperties(); - aAttrIter.OutAttr( nCurrentPos ); + aAttrIter.OutAttr( nCurrentPos, false ); AttrOutput().EndRunProperties( pRedlineData ); } @@ -2583,7 +2575,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) if (0 != nEnd) { AttrOutput().StartRunProperties(); - aAttrIter.OutAttr( nCurrentPos ); + aAttrIter.OutAttr( nCurrentPos, false ); AttrOutput().EndRunProperties( pRedlineData ); } AttrOutput().RunText( aSavedSnippet, eChrSet ); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 8845e9a09477..03e6411475d2 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1505,7 +1505,7 @@ public: void NextPos() { if ( nCurrentSwPos < SAL_MAX_INT32 ) nCurrentSwPos = SearchNext( nCurrentSwPos + 1 ); } - void OutAttr( sal_Int32 nSwPos, bool bRuby = false, bool bWriteCombinedChars = false ); + void OutAttr( sal_Int32 nSwPos, bool bWriteCombinedChars ); virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const override; virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const override; int OutAttrWithRange(const SwTextNode& rNode, sal_Int32 nPos); diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index c14289d70ccf..2636527176a9 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -480,7 +480,7 @@ int documentStartPageNumber(SwMailMergeConfigItem* pConfigItem, int document, bo if (!bIgnoreEmpty) shell.GetPageNum(page, o3tl::temporary(sal_uInt16())); else - page = shell.GetPageNumSeqNonEmpty(true, true); + page = shell.GetPageNumSeqNonEmpty(); shell.Pop(SwCursorShell::PopMode::DeleteCurrent); return page; } @@ -506,7 +506,7 @@ int documentEndPageNumber(SwMailMergeConfigItem* pConfigItem, int document, bool if (!bIgnoreEmpty) shell.GetPageNum(page, o3tl::temporary(sal_uInt16())); else - page = shell.GetPageNumSeqNonEmpty(true, true); + page = shell.GetPageNumSeqNonEmpty(); shell.Pop(SwCursorShell::PopMode::DeleteCurrent); return page; } |