summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-07-04 16:08:13 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-07-04 16:08:13 +0100
commitb95cfee03ca6eb63eb94593ced389c7f442f2d69 (patch)
treeb9f9fc73eebe269cb9a85fe83888bf64d153386e /canvas
parent37f6fc4933769cb031b63d607a607a42654732f0 (diff)
fix fdo#51547: revert "Some cppcheck cleaning"
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/canvashelper.cxx4
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx2
-rw-r--r--canvas/source/vcl/impltools.cxx14
3 files changed, 10 insertions, 10 deletions
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 7dc47519682c..fde6ebe2d271 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -483,6 +483,7 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
const int nTransparency( setupOutDevState( viewState, renderState, FILL_COLOR ) );
+ const int nTransPercent( (nTransparency * 100 + 128) / 255 ); // normal rounding, no truncation here
::basegfx::B2DPolyPolygon aB2DPolyPoly(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon));
aB2DPolyPoly.setClosed(true); // ensure closed poly, otherwise VCL does not fill
@@ -496,8 +497,7 @@ namespace vclcanvas
}
else
{
- const sal_uInt16 nTransPercent( (nTransparency * 100 + 128) / 255 ); // normal rounding, no truncation here
- mpOutDev->getOutDev().DrawTransparent( aPolyPoly, nTransPercent );
+ mpOutDev->getOutDev().DrawTransparent( aPolyPoly, (sal_uInt16)nTransPercent );
}
if( mp2ndOutDev )
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index df293a5919c7..1021d33de702 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -683,6 +683,7 @@ namespace vclcanvas
{
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDev );
+ const int nTransparency( setupOutDevState( viewState, renderState, IGNORE_COLOR ) );
PolyPolygon aPolyPoly( tools::mapPolyPolygon(
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(xPolyPolygon),
viewState, renderState ) );
@@ -710,7 +711,6 @@ namespace vclcanvas
}
else
{
- const int nTransparency( setupOutDevState( viewState, renderState, IGNORE_COLOR ) );
std::vector< ::Color > aColors(rValues.maColors.getLength());
std::transform(&rValues.maColors[0],
&rValues.maColors[0]+rValues.maColors.getLength(),
diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx
index 09e20b45a299..0484d1ed1e49 100644
--- a/canvas/source/vcl/impltools.cxx
+++ b/canvas/source/vcl/impltools.cxx
@@ -245,6 +245,13 @@ namespace vclcanvas
aSrcRect,
rTransform );
+ const bool bModulateColors( eModulationMode == MODULATE_WITH_DEVICECOLOR &&
+ rDeviceColor.getLength() > 2 );
+ const double nRedModulation( bModulateColors ? rDeviceColor[0] : 1.0 );
+ const double nGreenModulation( bModulateColors ? rDeviceColor[1] : 1.0 );
+ const double nBlueModulation( bModulateColors ? rDeviceColor[2] : 1.0 );
+ const double nAlphaModulation( bModulateColors && rDeviceColor.getLength() > 3 ?
+ rDeviceColor[3] : 1.0 );
Bitmap aSrcBitmap( rBitmap.GetBitmap() );
Bitmap aSrcAlpha;
@@ -329,13 +336,6 @@ namespace vclcanvas
::basegfx::B2DHomMatrix aTransform( aLocalTransform );
aTransform.invert();
- const bool bModulateColors( eModulationMode == MODULATE_WITH_DEVICECOLOR &&
- rDeviceColor.getLength() > 2 );
- const double nRedModulation( bModulateColors ? rDeviceColor[0] : 1.0 );
- const double nGreenModulation( bModulateColors ? rDeviceColor[1] : 1.0 );
- const double nBlueModulation( bModulateColors ? rDeviceColor[2] : 1.0 );
- const double nAlphaModulation( bModulateColors && rDeviceColor.getLength() > 3 ?
- rDeviceColor[3] : 1.0 );
// for the time being, always read as ARGB
for( int y=0; y<aDestBmpSize.Height(); ++y )
{