From bef3818dbedba467a257e2573e298d98062be37b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 13 Feb 2019 15:19:56 +0100 Subject: sw btlr writing mode: add a layout-level test Fails with commit e8b9572bf89f55463f2c879a401ed62efc165d95 (sw btlr writing mode: implement initial layout, 2019-02-12) reverted. Change-Id: Ic68ef53a8b5bf86678d7e67c9960501f23341268 Reviewed-on: https://gerrit.libreoffice.org/67776 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/qa/extras/layout/data/btlr-cell.odt | Bin 0 -> 9174 bytes sw/qa/extras/layout/layout.cxx | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 sw/qa/extras/layout/data/btlr-cell.odt diff --git a/sw/qa/extras/layout/data/btlr-cell.odt b/sw/qa/extras/layout/data/btlr-cell.odt new file mode 100644 index 000000000000..c010fa9f51b6 Binary files /dev/null and b/sw/qa/extras/layout/data/btlr-cell.odt differ diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index f02d8a3fbbbc..77c826dba30d 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -67,6 +67,7 @@ public: void testTdf122878(); void testTdf115094(); void testTdf122607(); + void testBtlrCell(); CPPUNIT_TEST_SUITE(SwLayoutWriter); CPPUNIT_TEST(testRedlineFootnotes); @@ -107,6 +108,7 @@ public: CPPUNIT_TEST(testTdf122878); CPPUNIT_TEST(testTdf115094); CPPUNIT_TEST(testTdf122607); + CPPUNIT_TEST(testBtlrCell); CPPUNIT_TEST_SUITE_END(); private: @@ -2787,6 +2789,23 @@ void SwLayoutWriter::testTdf122607() "Portion", "Fax:"); } +void SwLayoutWriter::testBtlrCell() +{ + SwDoc* pDoc = createDoc("btlr-cell.odt"); + SwDocShell* pShell = pDoc->GetDocShell(); + + // Dump the rendering of the first page as an XML file. + std::shared_ptr xMetaFile = pShell->GetPreviewMetaFile(); + MetafileXmlDump dumper; + xmlDocPtr pXmlDoc = dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the accompanying fix in place, this test would have failed, as + // the orientation was 0 (layout did not take btlr direction request from + // doc model). + assertXPath(pXmlDoc, "//font[1]", "orientation", "900"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwLayoutWriter); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit