From ee4223bf079b1225e57a51772f6693f69c0e83bd Mon Sep 17 00:00:00 2001 From: Serge Krot Date: Wed, 15 Jan 2020 20:18:15 +0100 Subject: tdf#126795 docx export and TabsRelativeToIndent: added unit test Change-Id: I233a40133392757978b27666853a1fcef2e00a07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86878 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- .../data/tdf126795_TabsRelativeToIndent0.odt | Bin 0 -> 16401 bytes .../data/tdf126795_TabsRelativeToIndent1.odt | Bin 0 -> 16424 bytes sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 16 ++++++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt create mode 100644 sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt diff --git a/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt new file mode 100644 index 000000000000..e650076a096a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt differ diff --git a/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt new file mode 100644 index 000000000000..da2eae76bb14 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index aa57c48f19e1..9cb1474c5603 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -97,6 +97,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf121665_back2backColumnBreaks, "tdf121665_back2ba style::BreakType_COLUMN_BEFORE, getProperty(getParagraph(2), "BreakType")); } +DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent0, "tdf126795_TabsRelativeToIndent0.odt") +{ + uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence >(getParagraph( 2 ), "ParaTabStops"); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); + CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(499), stops[ 0 ].Position ); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent1, "tdf126795_TabsRelativeToIndent1.odt") +{ + uno::Sequence< style::TabStop > stops = getProperty< uno::Sequence >(getParagraph( 2 ), "ParaTabStops"); + CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength()); + CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(499), stops[ 0 ].Position ); +} + DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, "tdf46938_clearTabStop.docx") { // Number of tabstops should be zero, overriding the one in the style -- cgit