summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-10-17 11:17:14 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-10-17 12:03:08 +0200
commit6fc868c6535932bedfa0fc51d8dd5a1814d73ee8 (patch)
tree5c4bfa68546686d18fa066a447804bc0956b18ba /sw
parent76737b0fe2e8afa3248ceee5025415c807d8687b (diff)
fix import of RTF_PARD inside RTF_SHPTXT
Change-Id: Id722b61cec9b8ae6550122e192affecadfcb1217
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/shptxt-pard.rtf19
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx12
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/shptxt-pard.rtf b/sw/qa/extras/rtfimport/data/shptxt-pard.rtf
new file mode 100644
index 000000000000..31c9df556bc6
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/shptxt-pard.rtf
@@ -0,0 +1,19 @@
+{\rtf1
+first par
+\par
+{\shp
+{\*\shpinst\shpleft1371\shptop6712\shpright2453\shpbottom6887\shpfhdr0\shpbxpage\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1026
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+{\shptxt \ltrpar
+\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1033\langfe1033\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp1033
+\rtlch\fcs1
+\af0\afs16\alang1037 \ltrch\fcs0 \f0\fs16\insrsid11286377 \hich\af0\dbch\af31505\loch\f0 shape text
+\par
+}
+}
+}
+second par\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index d0376b7aca40..976a4f8d893a 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -115,6 +115,7 @@ public:
void testFdo52475();
void testFdo55493();
void testCopyPastePageStyle();
+ void testShptxtPard();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -169,6 +170,7 @@ public:
CPPUNIT_TEST(testFdo52475);
CPPUNIT_TEST(testFdo55493);
CPPUNIT_TEST(testCopyPastePageStyle);
+ CPPUNIT_TEST(testShptxtPard);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -893,6 +895,16 @@ void Test::testCopyPastePageStyle()
CPPUNIT_ASSERT_EQUAL(sal_Int32(21001), getProperty<sal_Int32>(xPropertySet, "Width")); // Was letter, i.e. 21590
}
+void Test::testShptxtPard()
+{
+ // The problem was that \pard inside \shptxt caused loss of shape text
+ load("shptxt-pard.rtf");
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<text::XText> xText(xDraws->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("shape text"), xText->getString());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();