From 0db96caf0fcce09b87621c11b584a6d81cc7df86 Mon Sep 17 00:00:00 2001 From: Joren De Cuyper Date: Thu, 14 May 2015 12:56:10 +0200 Subject: tdf#76941 and tdf#87539: docx export image greyscale, watermark, black&white Thanks to Miklos :) Change-Id: Ib6344ff654e39bf712d7071545573fb2ec525b63 Reviewed-on: https://gerrit.libreoffice.org/15733 Tested-by: Jenkins Reviewed-by: Joren De Cuyper --- sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'sw/qa/extras/ooxmlexport/ooxmlexport7.cxx') diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 6dec1e137b11..03afe283e368 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -948,6 +948,36 @@ DECLARE_OOXMLEXPORT_TEST(testPictureWrapPolygon, "picture-wrap-polygon.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength()); } +DECLARE_OOXMLEXPORT_TEST(testPictureColormodeGrayscale, "picture_colormode_grayscale.docx") +{ + // THe problem was that the grayscale was not exported + xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:inline/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:grayscl", 1); +} + +DECLARE_OOXMLEXPORT_TEST(testPictureColormodeBlackWhite, "picture_colormode_black_white.odt") +{ + xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:biLevel", "thresh", "50000"); +} + +DECLARE_OOXMLEXPORT_TEST(testPictureColormodeWatermark, "picture_colormode_watermark.odt") +{ + xmlDocPtr pXmlDoc = parseExport ("word/document.xml"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "bright", "50000"); + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:drawing/wp:anchor/a:graphic/a:graphicData/pic:pic/pic:blipFill/a:blip/a:lum", "contrast", "-70000"); +} + + DECLARE_OOXMLEXPORT_TEST(testExportShadow, "bnc637947.odt") { // The problem was that shadows of shapes from non-OOXML origin were not exported to DrawingML -- cgit v1.2.3