summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-04-13 16:46:33 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2022-04-14 00:41:51 +0200
commit187bf06aabf1b730cfcd47cbdf976f58b4960dcb (patch)
treec7d6f9b8229b24850450770b99d5e1a0ce8bd813 /sw
parent056b81ff51f57da83c4d4b5de479bac1aa366694 (diff)
tdf#114303: sw_rtfexport4: Add unittest
Change-Id: Id07c834a58db7aedada8a923a464f554f30f3013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132973 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf114303.rtf11
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx13
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf114303.rtf b/sw/qa/extras/rtfexport/data/tdf114303.rtf
new file mode 100644
index 000000000000..78f866fc5d52
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf114303.rtf
@@ -0,0 +1,11 @@
+{\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\shpleft1120\shptop8200\shpright11320\shpbottom8200\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1\shpz0{\sp{\sn shapeType}{\sv 20}}}}
+{\par\plain\par
+}}
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index c2af71a93f63..276bdd963b26 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -15,6 +15,7 @@
#include <com/sun/star/text/XDocumentIndex.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/style/TabStop.hpp>
+#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <o3tl/cppunittraitshelper.hxx>
@@ -249,6 +250,18 @@ DECLARE_RTFEXPORT_TEST(testBtlrCell, "btlr-cell.rtf")
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL, getProperty<sal_Int16>(xC1, "WritingMode"));
}
+DECLARE_RTFEXPORT_TEST(testTdf114303, "tdf114303.rtf")
+{
+ CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::NONE,
+ getProperty<sal_Int16>(getShape(1), "HoriOrient"));
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 0
+ // - Actual : 1
+ CPPUNIT_ASSERT_EQUAL(text::VertOrientation::NONE,
+ getProperty<sal_Int16>(getShape(1), "VertOrient"));
+}
+
DECLARE_RTFEXPORT_TEST(testTbrlFrame, "tbrl-frame.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getShapes());