summaryrefslogtreecommitdiff
path: root/cppcanvas/source/mtfrenderer
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 15:46:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 18:20:32 +0200
commitf7f7fa8fe313b03e0ee683b2154a1bf49ee9d741 (patch)
treea073b2b4aada88849d341b7d220160fd3620484b /cppcanvas/source/mtfrenderer
parent803b49a3776c98e2d435c328d39d0f71d259d9e5 (diff)
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>
Diffstat (limited to 'cppcanvas/source/mtfrenderer')
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx106
1 files changed, 53 insertions, 53 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index db2edcd3bde1..c856a237f8bc 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -83,20 +83,20 @@ namespace
const cppcanvas::CanvasSharedPtr& rCanvas )
{
rIsColorSet = pAct->IsSetting();
- if (rIsColorSet)
- {
- ::Color aColor( pAct->GetColor() );
+ if (!rIsColorSet)
+ return;
- // force alpha part of color to
- // opaque. transparent painting is done
- // explicitly via MetaActionType::Transparent
- aColor.SetTransparency(0);
- //aColor.SetTransparency(128);
+ ::Color aColor( pAct->GetColor() );
- rColorSequence = vcl::unotools::colorToDoubleSequence(
- aColor,
- rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() );
- }
+ // force alpha part of color to
+ // opaque. transparent painting is done
+ // explicitly via MetaActionType::Transparent
+ aColor.SetTransparency(0);
+ //aColor.SetTransparency(128);
+
+ rColorSequence = vcl::unotools::colorToDoubleSequence(
+ aColor,
+ rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() );
}
void setupStrokeAttributes( rendering::StrokeAttributes& o_rStrokeAttributes,
@@ -150,46 +150,46 @@ namespace
}
}
- if( LineStyle::Dash == rLineInfo.GetStyle() )
- {
- const ::cppcanvas::internal::OutDevState& rState( rParms.mrStates.getState() );
+ if( LineStyle::Dash != rLineInfo.GetStyle() )
+ return;
- // TODO(F1): Interpret OutDev::GetRefPoint() for the start of the dashing.
+ const ::cppcanvas::internal::OutDevState& rState( rParms.mrStates.getState() );
- // interpret dash info only if explicitly enabled as
- // style
- const ::basegfx::B2DSize aDistance( rLineInfo.GetDistance(), 0 );
- const double nDistance( (rState.mapModeTransform * aDistance).getX() );
+ // TODO(F1): Interpret OutDev::GetRefPoint() for the start of the dashing.
- const ::basegfx::B2DSize aDashLen( rLineInfo.GetDashLen(), 0 );
- const double nDashLen( (rState.mapModeTransform * aDashLen).getX() );
+ // interpret dash info only if explicitly enabled as
+ // style
+ const ::basegfx::B2DSize aDistance( rLineInfo.GetDistance(), 0 );
+ const double nDistance( (rState.mapModeTransform * aDistance).getX() );
- const ::basegfx::B2DSize aDotLen( rLineInfo.GetDotLen(), 0 );
- const double nDotLen( (rState.mapModeTransform * aDotLen).getX() );
+ const ::basegfx::B2DSize aDashLen( rLineInfo.GetDashLen(), 0 );
+ const double nDashLen( (rState.mapModeTransform * aDashLen).getX() );
- const sal_Int32 nNumArryEntries( 2*rLineInfo.GetDashCount() +
- 2*rLineInfo.GetDotCount() );
+ const ::basegfx::B2DSize aDotLen( rLineInfo.GetDotLen(), 0 );
+ const double nDotLen( (rState.mapModeTransform * aDotLen).getX() );
- o_rStrokeAttributes.DashArray.realloc( nNumArryEntries );
- double* pDashArray = o_rStrokeAttributes.DashArray.getArray();
+ const sal_Int32 nNumArryEntries( 2*rLineInfo.GetDashCount() +
+ 2*rLineInfo.GetDotCount() );
+ o_rStrokeAttributes.DashArray.realloc( nNumArryEntries );
+ double* pDashArray = o_rStrokeAttributes.DashArray.getArray();
- // iteratively fill dash array, first with dashes, then
- // with dots.
+ // iteratively fill dash array, first with dashes, then
+ // with dots.
- sal_Int32 nCurrEntry=0;
- for( sal_Int32 i=0; i<rLineInfo.GetDashCount(); ++i )
- {
- pDashArray[nCurrEntry++] = nDashLen;
- pDashArray[nCurrEntry++] = nDistance;
- }
- for( sal_Int32 i=0; i<rLineInfo.GetDotCount(); ++i )
- {
- pDashArray[nCurrEntry++] = nDotLen;
- pDashArray[nCurrEntry++] = nDistance;
- }
+ sal_Int32 nCurrEntry=0;
+
+ for( sal_Int32 i=0; i<rLineInfo.GetDashCount(); ++i )
+ {
+ pDashArray[nCurrEntry++] = nDashLen;
+ pDashArray[nCurrEntry++] = nDistance;
+ }
+ for( sal_Int32 i=0; i<rLineInfo.GetDotCount(); ++i )
+ {
+ pDashArray[nCurrEntry++] = nDotLen;
+ pDashArray[nCurrEntry++] = nDistance;
}
}
@@ -1026,21 +1026,21 @@ namespace cppcanvas::internal
}
}
- if( pTextAction )
- {
- maActions.emplace_back(
- pTextAction,
- rParms.mrCurrActionIndex );
+ if( !pTextAction )
+ return;
- if ( pStrikeoutTextAction )
- {
- maActions.emplace_back(
- pStrikeoutTextAction,
- rParms.mrCurrActionIndex );
- }
+ maActions.emplace_back(
+ pTextAction,
+ rParms.mrCurrActionIndex );
- rParms.mrCurrActionIndex += pTextAction->getActionCount()-1;
+ if ( pStrikeoutTextAction )
+ {
+ maActions.emplace_back(
+ pStrikeoutTextAction,
+ rParms.mrCurrActionIndex );
}
+
+ rParms.mrCurrActionIndex += pTextAction->getActionCount()-1;
}
void ImplRenderer::updateClipping( const ::basegfx::B2DPolyPolygon& rClipPoly,