From 5b74eb68113d3721e1a3f9fa40024bf9b2a15f0c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 15 Nov 2017 10:18:43 +0200 Subject: loplugin:flatten in vcl Change-Id: I3527477277a9ae96eaf9fd068232f672da7c28c3 Reviewed-on: https://gerrit.libreoffice.org/44753 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- vcl/qa/cppunit/canvasbitmaptest.cxx | 51 +++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'vcl/qa/cppunit') diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index f8ad6160d256..7570f9c22672 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -207,34 +207,35 @@ void checkCanvasBitmap( const rtl::Reference& xBmp, CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "150th pixel is not white", 1.0, pRGBStart[150].Blue, 1E-12); - if( nOriginalDepth > 8 ) - { - uno::Sequence aARGBColor(1); - uno::Sequence aRGBColor(1); - uno::Sequence aPixel3, aPixel4; + if( nOriginalDepth <= 8 ) + return; - const Color aCol(COL_GREEN); - aARGBColor[0].Red = vcl::unotools::toDoubleColor(aCol.GetRed()); - aARGBColor[0].Green = vcl::unotools::toDoubleColor(aCol.GetGreen()); - aARGBColor[0].Blue = vcl::unotools::toDoubleColor(aCol.GetBlue()); - aARGBColor[0].Alpha = 1.0; - - aRGBColor[0].Red = vcl::unotools::toDoubleColor(aCol.GetRed()); - aRGBColor[0].Green = vcl::unotools::toDoubleColor(aCol.GetGreen()); - aRGBColor[0].Blue = vcl::unotools::toDoubleColor(aCol.GetBlue()); - - aPixel3 = xBmp->convertIntegerFromARGB( aARGBColor ); - aPixel4 = xBmp->getPixel( aLayout, geometry::IntegerPoint2D(5,0) ); - CPPUNIT_ASSERT_MESSAGE( "Green pixel from bitmap mismatch with manually converted green pixel", - bool(aPixel3 == aPixel4)); + uno::Sequence aARGBColor(1); + uno::Sequence aRGBColor(1); + uno::Sequence aPixel3, aPixel4; - if( !aContainedBmpEx.IsTransparent() ) - { - aPixel3 = xBmp->convertIntegerFromRGB( aRGBColor ); - CPPUNIT_ASSERT_MESSAGE( "Green pixel from bitmap mismatch with manually RGB-converted green pixel", - bool(aPixel3 == aPixel4)); - } + const Color aCol(COL_GREEN); + aARGBColor[0].Red = vcl::unotools::toDoubleColor(aCol.GetRed()); + aARGBColor[0].Green = vcl::unotools::toDoubleColor(aCol.GetGreen()); + aARGBColor[0].Blue = vcl::unotools::toDoubleColor(aCol.GetBlue()); + aARGBColor[0].Alpha = 1.0; + + aRGBColor[0].Red = vcl::unotools::toDoubleColor(aCol.GetRed()); + aRGBColor[0].Green = vcl::unotools::toDoubleColor(aCol.GetGreen()); + aRGBColor[0].Blue = vcl::unotools::toDoubleColor(aCol.GetBlue()); + + aPixel3 = xBmp->convertIntegerFromARGB( aARGBColor ); + aPixel4 = xBmp->getPixel( aLayout, geometry::IntegerPoint2D(5,0) ); + CPPUNIT_ASSERT_MESSAGE( "Green pixel from bitmap mismatch with manually converted green pixel", + bool(aPixel3 == aPixel4)); + + if( !aContainedBmpEx.IsTransparent() ) + { + aPixel3 = xBmp->convertIntegerFromRGB( aRGBColor ); + CPPUNIT_ASSERT_MESSAGE( "Green pixel from bitmap mismatch with manually RGB-converted green pixel", + bool(aPixel3 == aPixel4)); } + } class TestBitmap : public cppu::WeakImplHelper< rendering::XIntegerReadOnlyBitmap, -- cgit