From 4250b25c6ae361359300ab6ccde27230f8e01039 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 6 Jul 2017 14:49:15 +0200 Subject: teach unnecessaryparen loplugin about identifiers Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b Reviewed-on: https://gerrit.libreoffice.org/39737 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- filter/source/config/cache/filtercache.cxx | 6 ++---- filter/source/graphicfilter/icgm/cgm.cxx | 2 +- filter/source/msfilter/escherex.cxx | 8 ++++---- filter/source/msfilter/util.cxx | 2 +- filter/source/svg/units.cxx | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) (limited to 'filter/source') diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index eb3121fee602..b9d9bdf395ba 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -971,12 +971,10 @@ void FilterCache::impl_validateAndOptimize() if ( ( - (bSomeTypesShouldExist) && - (m_lTypes.empty()) + bSomeTypesShouldExist && m_lTypes.empty() ) || ( - (bAllFiltersShouldExist) && - (m_lFilters.empty()) + bAllFiltersShouldExist && m_lFilters.empty() ) ) { diff --git a/filter/source/graphicfilter/icgm/cgm.cxx b/filter/source/graphicfilter/icgm/cgm.cxx index 8a7226625beb..c841f7234a19 100644 --- a/filter/source/graphicfilter/icgm/cgm.cxx +++ b/filter/source/graphicfilter/icgm/cgm.cxx @@ -379,7 +379,7 @@ sal_uInt32 CGM::ImplGetBitmapColor( bool bDirect ) else { sal_uInt32 nIndex = ImplGetUI( pElement->nColorIndexPrecision ); - nTmp = pElement->aColorTable[ (sal_uInt8)( nIndex ) ] ; + nTmp = pElement->aColorTable[ (sal_uInt8)nIndex ] ; } return nTmp; } diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 423b5d0ede45..c79056f9dbf2 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -321,7 +321,7 @@ sal_uInt32 EscherPropertyContainer::ImplGetColor( const sal_uInt32 nSOColor, boo if ( bSwap ) { sal_uInt32 nColor = nSOColor & 0xff00; // green - nColor |= (sal_uInt8)( nSOColor ) << 16; // red + nColor |= (sal_uInt8) nSOColor << 16; // red nColor |= (sal_uInt8)( nSOColor >> 16 ); // blue return nColor; } @@ -1942,9 +1942,9 @@ bool EscherPropertyContainer::CreatePolygonProperties( sal_uInt8* pSegmentBuf = new sal_uInt8[ nSegmentBufSize ]; sal_uInt8* pPtr = pVerticesBuf; - *pPtr++ = (sal_uInt8)( nTotalPoints ); // Little endian + *pPtr++ = (sal_uInt8) nTotalPoints; // Little endian *pPtr++ = (sal_uInt8)( nTotalPoints >> 8 ); - *pPtr++ = (sal_uInt8)( nTotalPoints ); + *pPtr++ = (sal_uInt8) nTotalPoints; *pPtr++ = (sal_uInt8)( nTotalPoints >> 8 ); *pPtr++ = (sal_uInt8)0xf0; *pPtr++ = (sal_uInt8)0xff; @@ -5313,7 +5313,7 @@ void EscherEx::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& sal_uInt32 EscherEx::GetColor( const sal_uInt32 nSOColor ) { sal_uInt32 nColor = nSOColor & 0xff00; // Green - nColor |= (sal_uInt8)( nSOColor ) << 16; // Red + nColor |= (sal_uInt8) nSOColor << 16; // Red nColor |= (sal_uInt8)( nSOColor >> 16 ); // Blue return nColor; } diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx index 8ad5d92a4fdf..9cf01a0929a3 100644 --- a/filter/source/msfilter/util.cxx +++ b/filter/source/msfilter/util.cxx @@ -48,7 +48,7 @@ sal_uInt32 BGRToRGB(sal_uInt32 nColor) { sal_uInt8 r(static_cast(nColor&0xFF)), - g(static_cast(((nColor)>>8)&0xFF)), + g(static_cast((nColor>>8)&0xFF)), b(static_cast((nColor>>16)&0xFF)), t(static_cast((nColor>>24)&0xFF)); nColor = (t<<24) + (r<<16) + (g<<8) + b; diff --git a/filter/source/svg/units.cxx b/filter/source/svg/units.cxx index 84b82e6e90d0..f602971a3a27 100644 --- a/filter/source/svg/units.cxx +++ b/filter/source/svg/units.cxx @@ -101,7 +101,7 @@ double convLength( const OUString& sValue, const State& rState, char dir ) // Begin grammar ( //parse font-size keywords (ie: xx-large, medium ) - ( +(alpha_p) >> !(str_p("-") >> +alpha_p) )[assign_a(sVal)] + ( +alpha_p >> !(str_p("-") >> +alpha_p) )[assign_a(sVal)] >> str_p("")[assign_a(eUnit,SVG_LENGTH_FONT_SIZE)] | //take the first part and ignore the units ( +(anychar_p - -- cgit