sw/qa/extras/ww8export/ww8export2.cxx | 5 +---- sw/source/filter/ww8/wrtww8.cxx | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-)
New commits: commit 3c29b0ad690c77b2ec9189981da73ffaa717e30c Author: Justin Luth <[email protected]> Date: Mon Aug 28 22:30:32 2017 -0400 tdf#112074 doc export: re-calculate indent for RTL table 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 re-calculate LO's physical LEFT_AND_WIDTH indent to measure the distance from the right margin to the table. Importing already expects this recalculated indent. Change-Id: I9b8b7078aea8b7800cd31fbc11e2f27bd051be7d Reviewed-on: https://gerrit.libreoffice.org/41666 Tested-by: Jenkins <[email protected]> Reviewed-by: Justin Luth <[email protected]> Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index 632922f82a98..71587864e6cd 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -204,10 +204,7 @@ DECLARE_WW8EXPORT_TEST(testTdf112074_RTLtableJustification, "tdf112074_RTLtableJ 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_MESSAGE("Table Indent", getProperty<long>(xTable, "LeftMargin") > 3000); - } + CPPUNIT_ASSERT_MESSAGE("Table Indent", getProperty<long>(xTable, "LeftMargin") > 3000); } DECLARE_WW8EXPORT_TEST(testTdf104805, "tdf104805.doc") diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 13fa1c56272f..3b065c030afd 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2359,6 +2359,15 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t nTableOffset = rHori.GetPos(); const SvxLRSpaceItem& rLRSp = pFormat->GetLRSpace(); nTableOffset += rLRSp.GetLeft(); + + // convert offset to be measured from right margin in right-to-left tables + if ( nTableOffset && m_rWW8Export.TrueFrameDirection(*pFormat) == SvxFrameDirection::Horizontal_RL_TB ) + { + SwTwips nLeftPageMargin, nRightPageMargin; + const SwTwips nPageSize = m_rWW8Export.CurrentPageWidth(nLeftPageMargin, nRightPageMargin); + const SwTwips nTableWidth = pFormat->GetFrameSize().GetWidth(); + nTableOffset = nPageSize - nLeftPageMargin - nRightPageMargin - nTableWidth - nTableOffset; + } break; } } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
