diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-02-13 15:19:56 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-02-13 16:47:20 +0100 |
commit | bef3818dbedba467a257e2573e298d98062be37b (patch) | |
tree | 34e8753bc212cf89498ab62232e60d7b5ee482e4 | |
parent | e0dbab555bf6811e2ef5d908f481667fc0afef4f (diff) |
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 <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/qa/extras/layout/data/btlr-cell.odt | bin | 0 -> 9174 bytes | |||
-rw-r--r-- | sw/qa/extras/layout/layout.cxx | 19 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/layout/data/btlr-cell.odt b/sw/qa/extras/layout/data/btlr-cell.odt Binary files differnew file mode 100644 index 000000000000..c010fa9f51b6 --- /dev/null +++ b/sw/qa/extras/layout/data/btlr-cell.odt 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<GDIMetaFile> 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(); |