diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-03-05 23:17:48 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-03-10 19:46:51 +0100 |
commit | 106899c9d9d8c3f381fc6a6874c431dea1ea6057 (patch) | |
tree | 53d7c4a9d996c476b23dbd71854f3c50ef30c4dc /sw/qa | |
parent | 88b7ac11be5548f46c3664117173699046895610 (diff) |
use BitmapEx for testing bitmap contents, not DIB
The weirdo that tested the bitmap using the format-specific way
was ... me, in 2014.
Change-Id: I2cf96ba42da7099f2ce0b80ac53261c67321ef0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112041
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ww8export/ww8export.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index be85611d18e3..b7befec7c0cd 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -500,16 +500,12 @@ DECLARE_WW8EXPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.doc") uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY); uno::Reference<graphic::XGraphic> graphic; imageProperties->getPropertyValue( "Graphic" ) >>= graphic; - uno::Reference<awt::XBitmap> bitmap(graphic, uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL( sal_Int32(58), bitmap->getSize().Width ); - CPPUNIT_ASSERT_EQUAL( sal_Int32(320), bitmap->getSize().Height ); - const uno::Sequence< sal_Int8 > data = bitmap->getDIB(); // as .bmp data - CPPUNIT_ASSERT_EQUAL( sal_Int32(20278), data.getLength()); - CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b0])); // -50 = 206 pixel value - CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b1])); - CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b2])); - CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b3])); - CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6b4])); + Graphic vclGraphic(graphic); + BitmapEx bitmap(vclGraphic.GetBitmapEx()); + CPPUNIT_ASSERT_EQUAL( tools::Long(58), bitmap.GetSizePixel().Width()); + CPPUNIT_ASSERT_EQUAL( tools::Long(320), bitmap.GetSizePixel().Height()); + CPPUNIT_ASSERT_EQUAL( Color(206,206,206), bitmap.GetPixelColor(16,27)); + CPPUNIT_ASSERT_EQUAL( Color(206,206,206), bitmap.GetPixelColor(22,48)); } DECLARE_WW8EXPORT_TEST(testTdf95321, "tdf95321.doc") |