summaryrefslogtreecommitdiff
path: root/vcl/qa/cppunit
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-15 10:18:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-15 12:13:42 +0100
commit5b74eb68113d3721e1a3f9fa40024bf9b2a15f0c (patch)
tree1c959ccc7769fd8530a16cc904b5424d04faa208 /vcl/qa/cppunit
parentb4aa631867638b993fda98b1c4fcfc47e5c6a1aa (diff)
loplugin:flatten in vcl
Change-Id: I3527477277a9ae96eaf9fd068232f672da7c28c3 Reviewed-on: https://gerrit.libreoffice.org/44753 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa/cppunit')
-rw-r--r--vcl/qa/cppunit/canvasbitmaptest.cxx51
1 files changed, 26 insertions, 25 deletions
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<VclCanvasBitmap>& xBmp,
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"150th pixel is not white", 1.0, pRGBStart[150].Blue, 1E-12);
- if( nOriginalDepth > 8 )
- {
- uno::Sequence<rendering::ARGBColor> aARGBColor(1);
- uno::Sequence<rendering::RGBColor> aRGBColor(1);
- uno::Sequence<sal_Int8> 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<rendering::ARGBColor> aARGBColor(1);
+ uno::Sequence<rendering::RGBColor> aRGBColor(1);
+ uno::Sequence<sal_Int8> 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,