summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-03-06 16:23:22 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-03-06 16:31:13 +0100
commitea66024d4da38a619f44c941b65e6a28b74214b9 (patch)
tree0240941cbb6f7066d99736e0a0e087fa2402fae0
parent1eaab77c718ffa254068ae6032862dfb5a03db67 (diff)
fdo#60722 testcase
Change-Id: Ib6097c844b2bc929c6ece31bcec62f27bfbf386c
-rw-r--r--sw/qa/extras/rtfimport/data/fdo60722.rtf13
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx21
2 files changed, 34 insertions, 0 deletions
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<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xShape(xDraws->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xShape, "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL(OUString("larger"), getProperty<OUString>(xShape, "Description"));
+
+ xShape.set(xDraws->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(xShape, "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL(OUString("smaller"), getProperty<OUString>(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<sal_uInt32>(xShape, "LineWidth"));
+ CPPUNIT_ASSERT_EQUAL(sal_uInt32(0), getProperty<sal_uInt32>(xShape, "LineColor"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();