From ea66024d4da38a619f44c941b65e6a28b74214b9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 6 Mar 2013 16:23:22 +0100 Subject: [PATCH] fdo#60722 testcase Change-Id: Ib6097c844b2bc929c6ece31bcec62f27bfbf386c --- sw/qa/extras/rtfimport/data/fdo60722.rtf | 13 +++++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 sw/qa/extras/rtfimport/data/fdo60722.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo60722.rtf b/sw/qa/extras/rtfimport/data/fdo60722.rtf new file mode 100644 index 000000000000..498df01fceb9 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo60722.rtf @@ -0,0 +1,13 @@ +{\rtf1\ansi\deff0 +{\fonttbl +{\f0\fnil\fcharset204\fprq0\cpg1251 Arial;} +{\f1\fnil\fcharset204\fprq0\cpg1251 Times New Roman;} +{\f2\fnil\fcharset204\fprq0\cpg1251 Courier New;} +} +{\*\viewkind1}{\*\viewscale100}\margl0\margr0\margt0\margb0 +\paperw11905\paperh16837 +{\shp{\*\shpinst\shpleft10480\shptop840\shpright11320\shpbottom840\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0{\sp{\sn shapeType}{\sv 20}}}} +{\shp{\*\shpinst\shpleft8900\shptop11940\shpright10360\shpbottom12320\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn wzDescription}{\sv smaller}}}} +{\shp{\*\shpinst\shpleft7920\shptop11040\shpright11320\shpbottom13440\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0{\sp{\sn shapeType}{\sv 1}}{\sp{\sn fFilled}{\sv 0}}{\sp{\sn wzDescription}{\sv larger}}}} +{\par\plain\par +}} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index e577f4269f15..819625f4f245 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -144,6 +144,7 @@ public: void testFdo58076_2(); void testFdo59953(); void testFdo59638(); + void testFdo60722(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -260,6 +261,7 @@ void Test::run() {"fdo58076-2.rtf", &Test::testFdo58076_2}, {"fdo59953.rtf", &Test::testFdo59953}, {"fdo59638.rtf", &Test::testFdo59638}, + {"fdo60722.rtf", &Test::testFdo60722}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1145,6 +1147,25 @@ void Test::testFdo59638() CPPUNIT_FAIL("no BulletChar property"); } +void Test::testFdo60722() +{ + // The problem was that the larger shape was over the smaller one, and not the other way around. + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference xShape(xDraws->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xShape, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(OUString("larger"), getProperty(xShape, "Description")); + + xShape.set(xDraws->getByIndex(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(xShape, "ZOrder")); + CPPUNIT_ASSERT_EQUAL(OUString("smaller"), getProperty(xShape, "Description")); + + // Color of the line was blue, and it had zero width. + xShape.set(xDraws->getByIndex(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(26), getProperty(xShape, "LineWidth")); + CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty(xShape, "LineColor")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT();