[Libreoffice-commits] core.git: sw/qa sw/source

Justin Luth justin_luth at sil.org
Thu Sep 7 09:29:51 UTC 2017


 sw/qa/extras/ww8export/ww8export2.cxx |    2 +-
 sw/source/filter/ww8/wrtww8.cxx       |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit f091460837835033b10df7674210b0856cda0ec9
Author: Justin Luth <justin_luth at sil.org>
Date:   Mon Aug 28 21:52:15 2017 -0400

    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 at libreoffice.org>
    Reviewed-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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;
         }


More information about the Libreoffice-commits mailing list