[Libreoffice-commits] core.git: sw/qa

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 1 05:35:17 UTC 2020


 sw/qa/extras/ooxmlimport/data/n777345.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |   14 ++++++--------
 2 files changed, 6 insertions(+), 8 deletions(-)

New commits:
commit d97c638d5a13e87670de5662d022e80625684a66
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Jun 30 17:01:34 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Jul 1 07:34:35 2020 +0200

    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 at collabora.com>

diff --git a/sw/qa/extras/ooxmlimport/data/n777345.docx b/sw/qa/extras/ooxmlimport/data/n777345.docx
index dc625881cc16..7e70b1426f26 100644
Binary files a/sw/qa/extras/ooxmlimport/data/n777345.docx and b/sw/qa/extras/ooxmlimport/data/n777345.docx differ
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")


More information about the Libreoffice-commits mailing list