diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-06-30 17:01:34 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-07-01 07:34:35 +0200 |
commit | d97c638d5a13e87670de5662d022e80625684a66 (patch) | |
tree | 3724d5103ad968daf1ae0c4db499e828bb661975 /sw | |
parent | 5b3edd4bc3dfa2736abfc3074033cb25d7d264ed (diff) |
change n777345.docx to check bitmap content instead of checksum
Bitmap checksums are unreliable, they often depend on underlying
implementation and whatnot.
Change-Id: Ifc13285d6eb7d6d050a1ec26b270e0533eaae8eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97533
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/n777345.docx | bin | 11277 -> 9360 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 14 |
2 files changed, 6 insertions, 8 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/n777345.docx b/sw/qa/extras/ooxmlimport/data/n777345.docx Binary files differindex dc625881cc16..7e70b1426f26 100644 --- a/sw/qa/extras/ooxmlimport/data/n777345.docx +++ b/sw/qa/extras/ooxmlimport/data/n777345.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index b2e67a1d3769..c1001d1275a0 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -461,18 +461,16 @@ DECLARE_OOXMLIMPORT_TEST(testN775899, "n775899.docx") DECLARE_OOXMLIMPORT_TEST(testN777345, "n777345.docx") { -#if !defined(MACOSX) -#if !defined(_WIN32) // The problem was that v:imagedata inside v:rect was ignored. uno::Reference<document::XEmbeddedObjectSupplier2> xSupplier(getShape(1), uno::UNO_QUERY); uno::Reference<graphic::XGraphic> xGraphic = xSupplier->getReplacementGraphic(); Graphic aGraphic(xGraphic); - // If this changes later, feel free to update it, but make sure it's not - // the checksum of a white/transparent placeholder rectangle. - // tdf#119180 update needed now - CPPUNIT_ASSERT_EQUAL(BitmapChecksum(SAL_CONST_UINT64(15258412514674086030)), aGraphic.GetChecksum()); -#endif -#endif + BitmapEx aBitmap = aGraphic.GetBitmapEx(); + CPPUNIT_ASSERT_EQUAL( Size( 17, 16 ), aBitmap.GetSizePixel()); + CPPUNIT_ASSERT_EQUAL( COL_BLACK, aBitmap.GetPixelColor( 0, 0 )); + CPPUNIT_ASSERT_EQUAL( COL_BLACK, aBitmap.GetPixelColor( 16, 15 )); + CPPUNIT_ASSERT_EQUAL( Color( 153, 0, 0 ), aBitmap.GetPixelColor( 16, 0 )); + CPPUNIT_ASSERT_EQUAL( Color( 153, 0, 0 ), aBitmap.GetPixelColor( 0, 15 )); } DECLARE_OOXMLIMPORT_TEST(testN778140, "n778140.docx") |