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

Michael Stahl mstahl at redhat.com
Wed Jun 10 13:54:58 PDT 2015


 sw/qa/extras/odfexport/odfexport.cxx |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit dc4d9481f36a18db1dfe3b931780edbe32266e5f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 10 22:47:48 2015 +0200

    tdf#90640: add a unit test for this
    
    Change-Id: I72aecb66d0de4ba2bc3a44f664aab8170ffb3d0f

diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 9960e49..68c0e5a 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -184,6 +184,17 @@ DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt")
     CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextFrame, "FillBitmapTile"));
     aGradientxTextFrame = getProperty<awt::Gradient>(xTextFrame, "FillTransparenceGradient");
     CPPUNIT_ASSERT_EQUAL(css::awt::GradientStyle_LINEAR, aGradientxTextFrame.Style);
+
+    if (xmlDocPtr pXmlDoc = parseExport("content.xml"))
+    {
+        // check that there are 3 background-image elements
+        assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap']/style:background-image[@style:repeat='stretch']", 3);
+        // tdf#90640: check that one of them is 55% opaque
+        assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap' and @fo:background-color='transparent' and @draw:opacity='55%']/style:background-image[@style:repeat='stretch' and @draw:opacity='55%']", 1);
+        // tdf#90640: check that one of them is 43% opaque
+        // (emulated - hopefully not with rounding errors)
+        assertXPath(pXmlDoc, "//style:style[@style:parent-style-name='Frame' and @style:family='graphic']/style:graphic-properties[@draw:fill='bitmap' and @fo:background-color='transparent' and @draw:opacity-name='Transparency_20_1']/style:background-image[@style:repeat='stretch' and @draw:opacity='43%']", 1);
+    }
 }
 
 DECLARE_ODFEXPORT_TEST(testFdo38244, "fdo38244.odt")


More information about the Libreoffice-commits mailing list