diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-07 08:09:35 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-03-07 09:16:00 +0000 |
commit | 359e0b47a0f96ffa595a0c38a5e5318d797812fe (patch) | |
tree | 3695eb961668945dda469fc659337cbdd8c89520 /sw | |
parent | cc84aaf70ac56092b32d1d329143eca0550dce12 (diff) |
loplugin:unuseddefaultparams
Change-Id: Ia414f7845425ef73859ed04853378e96cc738795
Reviewed-on: https://gerrit.libreoffice.org/22971
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/editsh.hxx | 2 | ||||
-rw-r--r-- | sw/inc/format.hxx | 5 | ||||
-rw-r--r-- | sw/inc/ndtxt.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/attr/format.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/edit/edsect.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 16 |
6 files changed, 17 insertions, 30 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index b866ffc4abe9..6f4088aa82e6 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -829,7 +829,7 @@ public: void DelSectionFormat( size_t nFormat); void UpdateSection( size_t const nSect, SwSectionData &, SfxItemSet const*const = nullptr); - bool IsAnySectionInDoc( bool bChkReadOnly = false ) const; + bool IsAnySectionInDoc() const; OUString GetUniqueSectionName( const OUString* pChkStr = nullptr ) const; diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index d3350d9b6422..f629093fff73 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -81,7 +81,7 @@ public: virtual bool GetInfo( SfxPoolItem& ) const override; /// Copy attributes even among documents. - void CopyAttrs( const SwFormat&, bool bReplace=true ); + void CopyAttrs( const SwFormat& ); /// Delete all attributes that are not in rFormat. void DelDiffs( const SfxItemSet& rSet ); @@ -97,8 +97,7 @@ public: //UUUUinline SfxItemState GetItemState( sal_uInt16 nWhich, bool bSrchInParent = true, const SfxPoolItem **ppItem = nullptr ) const; - SfxItemState GetBackgroundState(SvxBrushItem &rItem, - bool bSrchInParent = true) const; + SfxItemState GetBackgroundState(SvxBrushItem &rItem) const; virtual bool SetFormatAttr( const SfxPoolItem& rAttr ); virtual bool SetFormatAttr( const SfxItemSet& rSet ); virtual bool ResetFormatAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 ); diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index cf196d0203a0..94c8003b87b6 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -693,8 +693,7 @@ public: bool bWithNum = false, bool bWithFootnote = true, bool bReplaceTabsWithSpaces = false ) const; - OUString GetRedlineText( sal_Int32 nIdx = 0, - sal_Int32 nLen = SAL_MAX_INT32 ) const; + OUString GetRedlineText() const; /** @return actual count of initial chars for initial-function. If nWishLen == 0 that of first word. */ diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index 8210df867d83..e958b2eb4dae 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -175,7 +175,7 @@ void SwFormat::SetName( const OUString& rNewName, bool bBroadcast ) in which <this> is defined. Currently this is important for DropCaps because that contains data that needs to be copied deeply. */ -void SwFormat::CopyAttrs( const SwFormat& rFormat, bool bReplace ) +void SwFormat::CopyAttrs( const SwFormat& rFormat ) { // copy only array with attributes delta if ( IsInCache() ) @@ -188,13 +188,6 @@ void SwFormat::CopyAttrs( const SwFormat& rFormat, bool bReplace ) // special treatments for some attributes SwAttrSet* pChgSet = const_cast<SwAttrSet*>(&rFormat.m_aSet); - if( !bReplace ) // refresh only those that are not set? - { - if( pChgSet == &rFormat.m_aSet ) - pChgSet = new SwAttrSet( rFormat.m_aSet ); - pChgSet->Differentiate( m_aSet ); - } - // copy only array with attributes delta if( pChgSet->GetPool() != m_aSet.GetPool() ) pChgSet->CopyToModify( *this ); @@ -450,7 +443,7 @@ SfxItemState SwFormat::GetItemState( sal_uInt16 nWhich, bool bSrchInParent, cons return m_aSet.GetItemState( nWhich, bSrchInParent, ppItem ); } -SfxItemState SwFormat::GetBackgroundState(SvxBrushItem &rItem, bool bSrchInParent) const +SfxItemState SwFormat::GetBackgroundState(SvxBrushItem &rItem) const { if (supportsFullDrawingLayerFillAttributeSet()) { @@ -463,7 +456,7 @@ SfxItemState SwFormat::GetBackgroundState(SvxBrushItem &rItem, bool bSrchInParen // if yes, fill the local SvxBrushItem using the new fill attributes // as good as possible to have an instance for the pointer to point // to and return as state that it is set - rItem = getSvxBrushItemFromSourceSet(m_aSet, RES_BACKGROUND, bSrchInParent); + rItem = getSvxBrushItemFromSourceSet(m_aSet, RES_BACKGROUND); return SfxItemState::SET; } @@ -472,7 +465,7 @@ SfxItemState SwFormat::GetBackgroundState(SvxBrushItem &rItem, bool bSrchInParen } const SfxPoolItem* pItem = nullptr; - SfxItemState eRet = m_aSet.GetItemState(RES_BACKGROUND, bSrchInParent, &pItem); + SfxItemState eRet = m_aSet.GetItemState(RES_BACKGROUND, true, &pItem); if (pItem) rItem = *static_cast<const SvxBrushItem*>(pItem); return eRet; diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index 833fc1f53a31..c0abcf0fa33d 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -115,7 +115,7 @@ size_t SwEditShell::GetSectionFormatCount() const return GetDoc()->GetSections().size(); } -bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly ) const +bool SwEditShell::IsAnySectionInDoc() const { const SwSectionFormats& rFormats = GetDoc()->GetSections(); @@ -126,9 +126,7 @@ bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly ) const ( (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION && TOX_HEADER_SECTION != eTmpType ) ) { - const SwSection& rSect = *pFormat->GetSection(); - if( !bChkReadOnly || rSect.IsProtectFlag() ) - return true; + return true; } } return false; diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 6c6350669c66..cf08c69ec0f3 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3211,7 +3211,7 @@ bool SwTextNode::GetExpandText( SwTextNode& rDestNd, const SwIndex* pDestIdx, return true; } -OUString SwTextNode::GetRedlineText( sal_Int32 nIdx, sal_Int32 nLen ) const +OUString SwTextNode::GetRedlineText() const { std::vector<sal_Int32> aRedlArr; const SwDoc* pDoc = GetDoc(); @@ -3256,20 +3256,18 @@ OUString SwTextNode::GetRedlineText( sal_Int32 nIdx, sal_Int32 nLen ) const } } - OUStringBuffer aText((nLen > GetText().getLength()) - ? GetText().copy(nIdx) - : GetText().copy(nIdx, nLen)); + OUStringBuffer aText(GetText()); - sal_Int32 nTextStt = nIdx; - sal_Int32 nIdxEnd = nIdx + aText.getLength(); + sal_Int32 nTextStt = 0; + sal_Int32 nIdxEnd = aText.getLength(); for( size_t n = 0; n < aRedlArr.size(); n += 2 ) { sal_Int32 nStt = aRedlArr[ n ]; sal_Int32 nEnd = aRedlArr[ n+1 ]; - if( ( nIdx <= nStt && nStt <= nIdxEnd ) || - ( nIdx <= nEnd && nEnd <= nIdxEnd )) + if( ( 0 <= nStt && nStt <= nIdxEnd ) || + ( 0 <= nEnd && nEnd <= nIdxEnd )) { - if( nStt < nIdx ) nStt = nIdx; + if( nStt < 0 ) nStt = 0; if( nIdxEnd < nEnd ) nEnd = nIdxEnd; const sal_Int32 nDelCnt = nEnd - nStt; aText.remove(nStt - nTextStt, nDelCnt); |