diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-06 10:19:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-06 11:53:58 +0100 |
commit | 004cc81168ce4e9f9b2f8fddf3361f8c23323673 (patch) | |
tree | 16c7009a3fac88766214ff073cab5562555a2f3a /filter | |
parent | 2429c626b4ae5efcd2edf47dabf4add6a7384dff (diff) |
loplugin:collapseif in dbaccess..lotuswordpro
Change-Id: Ia2a0d25c3833dfde0cd28337361f3cbd2aa29662
Reviewed-on: https://gerrit.libreoffice.org/62934
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/eps/eps.cxx | 7 | ||||
-rw-r--r-- | filter/source/msfilter/escherex.cxx | 40 | ||||
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 79 |
3 files changed, 57 insertions, 69 deletions
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index e131091b9ba1..c6a14bfeab0e 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -1672,11 +1672,8 @@ void PSWriter::ImplBmp( Bitmap const * pBitmap, Bitmap const * pMaskBitmap, cons bDoTrans = true; while (true) { - if ( mnLevel == 1 ) - { - if ( nHeight > 10 ) - nHeight = 8; - } + if ( mnLevel == 1 && nHeight > 10 ) + nHeight = 8; aRect = tools::Rectangle( Point( 0, nHeightOrg - nHeightLeft ), Size( nWidth, nHeight ) ); aRegion = vcl::Region( pMaskBitmap->CreateRegion( COL_BLACK, aRect ) ); diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index c158129fb6a5..ecffc34b4cb0 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1601,18 +1601,15 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans } } - if (!bConverted) + if (!bConverted && pGraphicProvider ) { - if ( pGraphicProvider ) + const OUString& rBaseURI( pGraphicProvider->GetBaseURI() ); + INetURLObject aBaseURI( rBaseURI ); + if( aBaseURI.GetProtocol() == aTmp.GetProtocol() ) { - const OUString& rBaseURI( pGraphicProvider->GetBaseURI() ); - INetURLObject aBaseURI( rBaseURI ); - if( aBaseURI.GetProtocol() == aTmp.GetProtocol() ) - { - OUString aRelUrl( INetURLObject::GetRelURL( rBaseURI, aGraphicUrl ) ); - if ( !aRelUrl.isEmpty() ) - aGraphicUrl = aRelUrl; - } + OUString aRelUrl( INetURLObject::GetRelURL( rBaseURI, aGraphicUrl ) ); + if ( !aRelUrl.isEmpty() ) + aGraphicUrl = aRelUrl; } } } @@ -2268,20 +2265,17 @@ void EscherPropertyContainer::CreateShadowProperties( if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "Shadow", true ) ) { bool bHasShadow = false; // shadow is possible only if at least a fillcolor, linecolor or graphic is set - if ( aAny >>= bHasShadow ) + if ( (aAny >>= bHasShadow) && bHasShadow ) { - if ( bHasShadow ) - { - nShadowFlags |= 2; - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowColor" ) ) - AddOpt( ESCHER_Prop_shadowColor, ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny) ) ); - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowXDistance" ) ) - AddOpt( ESCHER_Prop_shadowOffsetX, *o3tl::doAccess<sal_Int32>(aAny) * 360 ); - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowYDistance" ) ) - AddOpt( ESCHER_Prop_shadowOffsetY, *o3tl::doAccess<sal_Int32>(aAny) * 360 ); - if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowTransparence" ) ) - AddOpt( ESCHER_Prop_shadowOpacity, 0x10000 - (static_cast<sal_uInt32>(*o3tl::doAccess<sal_uInt16>(aAny)) * 655 ) ); - } + nShadowFlags |= 2; + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowColor" ) ) + AddOpt( ESCHER_Prop_shadowColor, ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny) ) ); + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowXDistance" ) ) + AddOpt( ESCHER_Prop_shadowOffsetX, *o3tl::doAccess<sal_Int32>(aAny) * 360 ); + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowYDistance" ) ) + AddOpt( ESCHER_Prop_shadowOffsetY, *o3tl::doAccess<sal_Int32>(aAny) * 360 ); + if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "ShadowTransparence" ) ) + AddOpt( ESCHER_Prop_shadowOpacity, 0x10000 - (static_cast<sal_uInt32>(*o3tl::doAccess<sal_uInt16>(aAny)) * 655 ) ); } } } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 7b6d979d445a..47360682cacd 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -647,56 +647,53 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver ) sal_uInt32 k, nPt = nC; css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > aSegments; pAny = aGeometryItem.GetPropertyValueByName( sPath, sSegments ); - if ( pAny ) + if ( pAny && (*pAny >>= aSegments) ) { - if ( *pAny >>= aSegments ) + for ( nPt = 0, k = 1; nC && ( k < static_cast<sal_uInt32>(aSegments.getLength()) ); k++ ) { - for ( nPt = 0, k = 1; nC && ( k < static_cast<sal_uInt32>(aSegments.getLength()) ); k++ ) + sal_Int16 j, nCnt2 = aSegments[ k ].Count; + if ( aSegments[ k ].Command != EnhancedCustomShapeSegmentCommand::UNKNOWN ) { - sal_Int16 j, nCnt2 = aSegments[ k ].Count; - if ( aSegments[ k ].Command != EnhancedCustomShapeSegmentCommand::UNKNOWN ) + for ( j = 0; nC && ( j < nCnt2 ); j++ ) { - for ( j = 0; nC && ( j < nCnt2 ); j++ ) + switch( aSegments[ k ].Command ) { - switch( aSegments[ k ].Command ) + case EnhancedCustomShapeSegmentCommand::ENDSUBPATH : + case EnhancedCustomShapeSegmentCommand::CLOSESUBPATH : + case EnhancedCustomShapeSegmentCommand::LINETO : + case EnhancedCustomShapeSegmentCommand::MOVETO : { - case EnhancedCustomShapeSegmentCommand::ENDSUBPATH : - case EnhancedCustomShapeSegmentCommand::CLOSESUBPATH : - case EnhancedCustomShapeSegmentCommand::LINETO : - case EnhancedCustomShapeSegmentCommand::MOVETO : - { - nC--; - nPt++; - } - break; - case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX : - case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY : - break; + nC--; + nPt++; + } + break; + case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTX : + case EnhancedCustomShapeSegmentCommand::ELLIPTICALQUADRANTY : + break; - case EnhancedCustomShapeSegmentCommand::CURVETO : - { - nC--; - nPt += 3; - } - break; + case EnhancedCustomShapeSegmentCommand::CURVETO : + { + nC--; + nPt += 3; + } + break; - case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO : - case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE : - { - nC--; - nPt += 3; - } - break; - case EnhancedCustomShapeSegmentCommand::ARCTO : - case EnhancedCustomShapeSegmentCommand::ARC : - case EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO : - case EnhancedCustomShapeSegmentCommand::CLOCKWISEARC : - { - nC--; - nPt += 4; - } - break; + case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSETO : + case EnhancedCustomShapeSegmentCommand::ANGLEELLIPSE : + { + nC--; + nPt += 3; + } + break; + case EnhancedCustomShapeSegmentCommand::ARCTO : + case EnhancedCustomShapeSegmentCommand::ARC : + case EnhancedCustomShapeSegmentCommand::CLOCKWISEARCTO : + case EnhancedCustomShapeSegmentCommand::CLOCKWISEARC : + { + nC--; + nPt += 4; } + break; } } } |