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>
This commit is contained in:
Xisco Fauli
2022-04-13 16:46:33 +02:00
parent 056b81ff51
commit 187bf06aab
2 changed files with 24 additions and 0 deletions

View File

@@ -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
}}

View File

@@ -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());