summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-03-05 23:17:48 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-03-10 19:46:51 +0100
commit106899c9d9d8c3f381fc6a6874c431dea1ea6057 (patch)
tree53d7c4a9d996c476b23dbd71854f3c50ef30c4dc
parent88b7ac11be5548f46c3664117173699046895610 (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>
-rw-r--r--sw/CppunitTest_sw_ww8export.mk1
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx16
2 files changed, 7 insertions, 10 deletions
diff --git a/sw/CppunitTest_sw_ww8export.mk b/sw/CppunitTest_sw_ww8export.mk
index beec46f3cc7f..e338a15f1947 100644
--- a/sw/CppunitTest_sw_ww8export.mk
+++ b/sw/CppunitTest_sw_ww8export.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ww8export, \
sw \
swqahelper \
tl \
+ vcl \
))
$(eval $(call gb_CppunitTest_use_externals,sw_ww8export,\
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")