From 92cb21ebeda98c5193c50c4cf7ef3d60611c2a52 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 12 Mar 2014 22:21:16 +0100 Subject: fdo#75872: ODF import: fix up graphics defaults stroke/fill colors These have changed a few times, notably in LO 4.0 with commit 895890563cb0cc5fa872bdfd06918a46cdda172d and AOO 4.0 with commit c0eb5e7772c848806db8ab461f77f9549c1d8b2b; unfortunately historic OOo and current AOO do not write the values into ODF files, whereas LO 4.x does (probably by accident, since 45d3577bc5726eee44f491fd30a7f11dc428431a by design). Try to set the defaults depending on the generator; since the defaults are not specified by ODF they are implementation defined anyway so this should be OK. Change-Id: I1270d6e0cdeea5cb493724a0998f661a0cf644f1 --- sw/qa/extras/odfimport/odfimport.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sw/qa/extras/odfimport/odfimport.cxx') diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index 8fa14b45581a..299fea7ae161 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -279,6 +279,26 @@ DECLARE_ODFIMPORT_TEST(testFdo56272, "fdo56272.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(422), xShape->getPosition().Y); // Was -2371 } +DECLARE_ODFIMPORT_TEST(testFdo75872_ooo33, "fdo75872_ooo33.odt") +{ + // graphics default style: line color and fill color changed + uno::Reference xShape = getShape(1); + CPPUNIT_ASSERT_EQUAL(sal_Int32(COL_BLACK), + getProperty(xShape, "LineColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(153, 204, 255)), + getProperty(xShape, "FillColor")); +} + +DECLARE_ODFIMPORT_TEST(testFdo75872_aoo40, "fdo75872_aoo40.odt") +{ + // graphics default style: line color and fill color changed + uno::Reference xShape = getShape(1); + CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(128, 128, 128)), + getProperty(xShape, "LineColor")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(RGB_COLORDATA(0xCF, 0xE7, 0xF5)), + getProperty(xShape, "FillColor")); +} + DECLARE_ODFIMPORT_TEST(testFdo55814, "fdo55814.odt") { uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); -- cgit v1.2.3