diff options
Diffstat (limited to 'cppcanvas/source/mtfrenderer/implrenderer.cxx')
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 106 |
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, |