summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfexport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-09-05 09:07:48 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-09-05 14:30:14 +0200
commit4cde2a01be75552a0b7d37f65cc4134cb48fea26 (patch)
tree7ec8a538684f285503bad5691aa712dae87c162e /sw/qa/extras/rtfexport
parent1f66a258f2371d516b6a031a46ab4ef5d973796b (diff)
tdf#104936 RTF export: implement ZOrder of TextFrames / shapes
This used to work by accident for the particular textbox, but broke with commit 38f2b8b3b16aab19a2564ec699d253d3dccecc3c (tdf#88811 SwXText::convertToTextFrame: handle shapes anchored to us, 2015-02-03), so write ZOrder explicitly, like other filters already do. Change-Id: Ie8f11f4ec77707fb5aec7a597544d589a99bf6ca Reviewed-on: https://gerrit.libreoffice.org/41921 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/extras/rtfexport')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf104936.rtf20
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx11
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf104936.rtf b/sw/qa/extras/rtfexport/data/tdf104936.rtf
new file mode 100644
index 000000000000..3f854b642500
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf104936.rtf
@@ -0,0 +1,20 @@
+{\rtf\ansi\ansicpg1251
+{\fonttbl
+{\f1\fcharset204 Arial}
+{\f2\fcharset204 Courier New}
+}
+{\colortbl;\red0\green0\blue0;}
+\viewkind1\paperw11340\paperh16840\margl0\margr0\margt460\margb1240
+\viewkind1\paperw11340\paperh16840\margl0\margr0\margt460\margb1240
+\viewkind1\paperw11340\paperh16840\margl0\margr0\margt460\margb1240
+\viewkind1\paperw11340\paperh16840\margl0\margr0\margt460\margb1240
+{\do\dobxpage\dobypage\dprect
+\dpx0\dpy450\dpxsize11160\dpysize1943
+\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255
+\dpfillbgcr255\dpfillbgcg255\dpfillbgcb255\dpfillpat1
+\dplinew0 \dplinehollow
+}
+{\pard \qc \pvpg\phpg\posx2786\posy1218\absw1080 \absh-235
+{\f2\fs20 \cf1 \b Hello\par}
+}
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 4d46f82819df..7b9107819005 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -867,6 +867,17 @@ DECLARE_RTFEXPORT_TEST(testCjklist38, "cjklist38.rtf")
CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH, numFormat);
}
+DECLARE_RTFEXPORT_TEST(testTdf104936, "tdf104936.rtf")
+{
+ uno::Reference<text::XTextRange> xShape1(getShape(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xShape1, "ZOrder"));
+ // This failed, the shape without text covered the shape with text.
+ CPPUNIT_ASSERT(xShape1->getString().isEmpty());
+ uno::Reference<text::XTextRange> xShape2(getShape(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), getProperty<sal_Int32>(xShape2, "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Hello"), xShape2->getString());
+}
+
DECLARE_RTFEXPORT_TEST(testTableRtl, "table-rtl.rtf")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);