loplugin:flatten in cppcanvas

Change-Id: I4303c31ad3de1ba71aa366b6dc203504b8fffd77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92453
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2020-04-17 15:46:19 +02:00
parent 803b49a377
commit f7f7fa8fe3
2 changed files with 88 additions and 88 deletions

View File

@@ -83,8 +83,9 @@ namespace
const cppcanvas::CanvasSharedPtr& rCanvas ) const cppcanvas::CanvasSharedPtr& rCanvas )
{ {
rIsColorSet = pAct->IsSetting(); rIsColorSet = pAct->IsSetting();
if (rIsColorSet) if (!rIsColorSet)
{ return;
::Color aColor( pAct->GetColor() ); ::Color aColor( pAct->GetColor() );
// force alpha part of color to // force alpha part of color to
@@ -97,7 +98,6 @@ namespace
aColor, aColor,
rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() ); rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() );
} }
}
void setupStrokeAttributes( rendering::StrokeAttributes& o_rStrokeAttributes, void setupStrokeAttributes( rendering::StrokeAttributes& o_rStrokeAttributes,
const ::cppcanvas::internal::ActionFactoryParameters& rParms, const ::cppcanvas::internal::ActionFactoryParameters& rParms,
@@ -150,8 +150,9 @@ namespace
} }
} }
if( LineStyle::Dash == rLineInfo.GetStyle() ) if( LineStyle::Dash != rLineInfo.GetStyle() )
{ return;
const ::cppcanvas::internal::OutDevState& rState( rParms.mrStates.getState() ); const ::cppcanvas::internal::OutDevState& rState( rParms.mrStates.getState() );
// TODO(F1): Interpret OutDev::GetRefPoint() for the start of the dashing. // TODO(F1): Interpret OutDev::GetRefPoint() for the start of the dashing.
@@ -191,7 +192,6 @@ namespace
pDashArray[nCurrEntry++] = nDistance; pDashArray[nCurrEntry++] = nDistance;
} }
} }
}
/** Create masked BitmapEx, where the white areas of rBitmap are /** Create masked BitmapEx, where the white areas of rBitmap are
@@ -1026,8 +1026,9 @@ namespace cppcanvas::internal
} }
} }
if( pTextAction ) if( !pTextAction )
{ return;
maActions.emplace_back( maActions.emplace_back(
pTextAction, pTextAction,
rParms.mrCurrActionIndex ); rParms.mrCurrActionIndex );
@@ -1041,7 +1042,6 @@ namespace cppcanvas::internal
rParms.mrCurrActionIndex += pTextAction->getActionCount()-1; rParms.mrCurrActionIndex += pTextAction->getActionCount()-1;
} }
}
void ImplRenderer::updateClipping( const ::basegfx::B2DPolyPolygon& rClipPoly, void ImplRenderer::updateClipping( const ::basegfx::B2DPolyPolygon& rClipPoly,
const ActionFactoryParameters& rParms, const ActionFactoryParameters& rParms,

View File

@@ -90,8 +90,9 @@ namespace cppcanvas::internal
{ {
OSL_ENSURE( mxSprite.is(), "ImplSprite::move(): Invalid sprite"); OSL_ENSURE( mxSprite.is(), "ImplSprite::move(): Invalid sprite");
if( mxSprite.is() ) if( !mxSprite.is() )
{ return;
rendering::ViewState aViewState; rendering::ViewState aViewState;
rendering::RenderState aRenderState; rendering::RenderState aRenderState;
@@ -105,7 +106,6 @@ namespace cppcanvas::internal
aViewState, aViewState,
aRenderState ); aRenderState );
} }
}
void ImplSprite::transform( const ::basegfx::B2DHomMatrix& rMatrix ) void ImplSprite::transform( const ::basegfx::B2DHomMatrix& rMatrix )
{ {
@@ -135,8 +135,9 @@ namespace cppcanvas::internal
OSL_ENSURE( mxGraphicDevice.is(), "ImplSprite::setClip(): Invalid canvas"); OSL_ENSURE( mxGraphicDevice.is(), "ImplSprite::setClip(): Invalid canvas");
OSL_ENSURE( mxSprite.is(), "ImplSprite::transform(): Invalid sprite"); OSL_ENSURE( mxSprite.is(), "ImplSprite::transform(): Invalid sprite");
if( mxSprite.is() && mxGraphicDevice.is() ) if( !(mxSprite.is() && mxGraphicDevice.is()) )
{ return;
::basegfx::B2DPolyPolygon aTransformedClipPoly( rClipPoly ); ::basegfx::B2DPolyPolygon aTransformedClipPoly( rClipPoly );
// extract linear part of canvas view transformation (linear means: // extract linear part of canvas view transformation (linear means:
@@ -151,7 +152,6 @@ namespace cppcanvas::internal
mxSprite->clip( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxGraphicDevice, mxSprite->clip( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( mxGraphicDevice,
aTransformedClipPoly ) ); aTransformedClipPoly ) );
} }
}
void ImplSprite::setClip() void ImplSprite::setClip()
{ {