diff options
author | Justin Luth <justin_luth@sil.org> | 2017-08-28 21:52:15 -0400 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-09-07 11:29:27 +0200 |
commit | f091460837835033b10df7674210b0856cda0ec9 (patch) | |
tree | 4fee838396376ed99a46479ecc7104c91f8402df | |
parent | b9c55dcd7485ab36f0187abf5265321ba832d117 (diff) |
tdf#112074 doc export: for RTL tables, LEFT_AND_WIDTH is RIGHT
In MSO tables, the only side that can have an indent is the
logical left orientation. In right-to-left tables, the indent
is measured from the physical right margin. So, we need to
save the table's orientation as RIGHT aligned.
In LO tables, only the physical left orientation can specify
the indent. Importing already calculates the corrected index size.
On export, the indent size will need to be re-calculated to account
for the reversed the margins, but that will come in a separate patch.
Change-Id: Ie2457791f913af2360af96f5038063d305e366de
Reviewed-on: https://gerrit.libreoffice.org/41665
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 0074969fbb13..632922f82a98 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -203,9 +203,9 @@ DECLARE_WW8EXPORT_TEST(testTdf112074_RTLtableJustification, "tdf112074_RTLtableJ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE("Right To Left writing mode", text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTable, "HoriOrient")); if ( !mbExported ) { - CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTable, "HoriOrient")); CPPUNIT_ASSERT_MESSAGE("Table Indent", getProperty<long>(xTable, "LeftMargin") > 3000); } } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 9bdba927e7bc..13fa1c56272f 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2244,6 +2244,14 @@ void WW8AttributeOutput::TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t m_rWW8Export.InsUInt16( 2 ); } break; + case text::HoriOrientation::LEFT_AND_WIDTH: + // Width can only be specified for the LOGICAL left, so in RTL, that is always PHYSICAL right + if ( bIsRTL ) + { + m_rWW8Export.InsUInt16( NS_sprm::sprmTJc90 ); //required for LO + m_rWW8Export.InsUInt16( 2 ); + } + break; default: break; } |