From 4f798ed25645b3b1c2e5100a6353cfbc4650becc Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 31 Oct 2017 10:41:55 +0200 Subject: loplugin:constantparam in editeng Change-Id: I0a07326d5b63e82ef16e02f75fd8523e3b73e1f4 Reviewed-on: https://gerrit.libreoffice.org/44096 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/rtf/rtfitem.cxx | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'editeng/source/rtf') diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 290c90686229..6b6f87e9e1ec 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -85,18 +85,6 @@ using namespace ::com::sun::star; using namespace editeng; -// Some helper functions -// char -inline const SvxEscapementItem& GetEscapement(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP) - { return static_cast(rSet.Get( nId,bInP)); } -inline const SvxLineSpacingItem& GetLineSpacing(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP) - { return static_cast(rSet.Get( nId,bInP)); } -// frm -inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,sal_uInt16 nId) - { return static_cast(rSet.Get( nId)); } -inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,sal_uInt16 nId) - { return static_cast(rSet.Get( nId)); } - void SvxRTFParser::SetScriptAttr( RTF_CharTypeDef eType, SfxItemSet& rSet, SfxPoolItem& rItem ) { @@ -340,7 +328,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_FI: if( aPardMap.nLRSpace ) { - SvxLRSpaceItem aLR( GetLRSpace(*pSet, aPardMap.nLRSpace )); + SvxLRSpaceItem aLR( + static_cast(pSet->Get(aPardMap.nLRSpace))); sal_uInt16 nSz = 0; if( -1 != nTokenValue ) { @@ -357,7 +346,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_LIN: if( aPardMap.nLRSpace ) { - SvxLRSpaceItem aLR( GetLRSpace(*pSet, aPardMap.nLRSpace )); + SvxLRSpaceItem aLR( + static_cast(pSet->Get(aPardMap.nLRSpace))); sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { @@ -374,7 +364,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_RIN: if( aPardMap.nLRSpace ) { - SvxLRSpaceItem aLR( GetLRSpace(*pSet, aPardMap.nLRSpace )); + SvxLRSpaceItem aLR( + static_cast(pSet->Get(aPardMap.nLRSpace))); sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { @@ -390,7 +381,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_SB: if( aPardMap.nULSpace ) { - SvxULSpaceItem aUL( GetULSpace(*pSet, aPardMap.nULSpace )); + SvxULSpaceItem aUL( + static_cast(pSet->Get(aPardMap.nULSpace))); sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { @@ -406,7 +398,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_SA: if( aPardMap.nULSpace ) { - SvxULSpaceItem aUL( GetULSpace(*pSet, aPardMap.nULSpace )); + SvxULSpaceItem aUL( + static_cast(pSet->Get(aPardMap.nULSpace))); sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { @@ -423,8 +416,8 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( aPardMap.nLinespacing && 1 == nTokenValue ) { // then switches to multi-line! - SvxLineSpacingItem aLSpace( GetLineSpacing( *pSet, - aPardMap.nLinespacing, false )); + SvxLineSpacingItem aLSpace( + static_cast(pSet->Get( aPardMap.nLinespacing,false))); // how much do you get from the line height value? @@ -565,7 +558,8 @@ SET_FONTALIGNMENT: nTokenValue = 6; if( IsCalcValue() ) CalcValue(); - const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, false ); + const SvxEscapementItem& rOld = + static_cast(pSet->Get( nEsc,false)); short nEs; sal_uInt8 nProp; if( DFLT_ESC_AUTO_SUPER == rOld.GetEsc() ) @@ -912,7 +906,8 @@ ATTR_SETOVERLINE: nTokenValue = 6; if( IsCalcValue() ) CalcValue(); - const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, false ); + const SvxEscapementItem& rOld = + static_cast(pSet->Get( nEsc,false)); short nEs; sal_uInt8 nProp; if( DFLT_ESC_AUTO_SUB == rOld.GetEsc() ) -- cgit