summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-03-10 20:32:22 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-03-11 11:52:16 +0100
commit076da4cd9d61adf15942a7bfc350bd0d268f64f1 (patch)
tree9b57114b6d2d85b93292c52e428faed09cb4d5cb /sw
parenta88effc4f53da8ae476f6a9f24b96e5948b17bee (diff)
tdf#136841: sw_ooxmlexport16: Add unittest
Change-Id: I951adefaf60e4c0c5d751ac1a886a9c746989a68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112282 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf136841.docxbin0 -> 15697 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport16.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf136841.docx b/sw/qa/extras/ooxmlexport/data/tdf136841.docx
new file mode 100644
index 000000000000..6f9020ee17f4
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf136841.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 5555a819c00e..319695655fcb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -157,6 +157,23 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf140572_docDefault_superscript, "tdf14
CPPUNIT_ASSERT_EQUAL( sal_Int16(0), getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharEscapement") );
}
+DECLARE_OOXMLEXPORT_TEST(testTdf136841, "tdf136841.docx")
+{
+ uno::Reference<drawing::XShape> image = getShape(1);
+ uno::Reference<beans::XPropertySet> imageProperties(image, uno::UNO_QUERY);
+ uno::Reference<graphic::XGraphic> graphic;
+ imageProperties->getPropertyValue( "Graphic" ) >>= graphic;
+ Graphic vclGraphic(graphic);
+ BitmapEx bitmap(vclGraphic.GetBitmapEx());
+ CPPUNIT_ASSERT_EQUAL( tools::Long(76), bitmap.GetSizePixel().Width());
+ CPPUNIT_ASSERT_EQUAL( tools::Long(76), bitmap.GetSizePixel().Height());
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: Color: R:228 G:71 B:69 A:0
+ // - Actual : Color: R:0 G:0 B:0 A:0
+ CPPUNIT_ASSERT_EQUAL( Color(228,71,69), bitmap.GetPixelColor(38,38));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf138953, "croppedAndRotated.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getShapes());