diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-04-11 21:37:16 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-04-12 12:07:50 +0200 |
commit | 0013f21ecd918e0541f165c3526a58f42dd75481 (patch) | |
tree | 52b2578ce1c6734863bc57ec4b7009568bc0c223 /sw/qa | |
parent | 4e7e3670c31329d60f5cc782abc4568c2aba33a7 (diff) |
tdf#124344 sw btlr writing mode, DOCX import: fix vertical alignment
The hack added in commit 3325e0f206ce864730468c3556ce06760042c157
(bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr,
2014-07-02) is no longer needed, actually just reverting it fixes the
problem, as then layout does the right thing.
No need to center paragraph adjustment to any kind of vertical
orientation, now that we have proper layout support.
Change-Id: I6aa74f5289a014c148fbd7c7ab03ec885d931daf
Reviewed-on: https://gerrit.libreoffice.org/70610
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 768ab16c8a48..dbe64afdc1dd 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -694,11 +694,19 @@ DECLARE_OOXMLEXPORT_TEST(testFootnote, "footnote.docx") DECLARE_OOXMLEXPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") { + // Note that this is btLr text, so layout and doc model horizontal/vertical is the opposite of + // each other. uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); - // Cell vertical alignment was NONE, should be CENTER. - CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty<sal_Int16>(xTable->getCellByName("A2"), "VertOrient")); + uno::Reference<table::XCell> xCell = xTable->getCellByName("A2"); + // Cell vertical alignment was CENTER, should be NONE. + CPPUNIT_ASSERT_EQUAL(text::VertOrientation::NONE, getProperty<sal_Int16>(xCell, "VertOrient")); + + // Cell horizontal alignment should be CENTER. + uno::Reference<text::XText> xCellText(xCell, uno::UNO_QUERY); + auto nActual = getProperty<sal_Int32>(getParagraphOfText(1, xCellText), "ParaAdjust"); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(style::ParagraphAdjust_CENTER), nActual); } DECLARE_OOXMLEXPORT_TEST(testFdo80555, "fdo80555.docx") |