[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/qa writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Apr 22 12:33:49 PDT 2015


 sw/qa/extras/rtfimport/data/tdf86182.rtf       |    4 ++++
 sw/qa/extras/rtfimport/rtfimport.cxx           |    7 +++++++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 502e606c84666df66fa1b099ae4147220f262841
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Apr 17 10:44:47 2015 +0200

    tdf#86182 RTF import: fix handling of \rtlpar
    
    Commit 558d5c25a0b1d6a937d33291a4b6cd7fca6cb15b (implement RTF_LTRPAR
    and RTF_RTLPAR, 2011-06-09) was just a guess, this one is the proper
    mapping.
    
    (cherry picked from commit 4ee2a882dddb395a816cd54004b634d57cfb2446)
    
    Conflicts:
    	sw/qa/extras/rtfimport/rtfimport.cxx
    	writerfilter/source/rtftok/rtfdocumentimpl.cxx
    
    Change-Id: I1156ef5ddc34264d761d3e64dd0537bc6ec0ced7
    Reviewed-on: https://gerrit.libreoffice.org/15481
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/qa/extras/rtfimport/data/tdf86182.rtf b/sw/qa/extras/rtfimport/data/tdf86182.rtf
new file mode 100644
index 0000000..d63c489
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf86182.rtf
@@ -0,0 +1,4 @@
+{\rtf1
+\rtlpar
+\u1662\'3f\u1587\'3f
+\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8dce8ee..6c52362 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -45,6 +45,7 @@
 #include <com/sun/star/text/WrapTextMode.hpp>
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/VertOrientation.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
 
 #include <rtl/ustring.hxx>
@@ -2258,6 +2259,12 @@ DECLARE_RTFIMPORT_TEST(testFdo75614, "tdf75614.rtf")
     CPPUNIT_ASSERT_EQUAL(OUString("after."), getRun(getParagraph(1), 3)->getString());
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf86182, "tdf86182.rtf")
+{
+    // Writing mode was the default, i.e. text::WritingMode2::CONTEXT.
+    CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(getParagraph(1), "WritingMode"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d589598..ad9954b 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -3028,7 +3028,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
     case RTF_RTLPAR:
     {
         RTFValue::Pointer_t pValue(new RTFValue(nKeyword == RTF_LTRPAR ? 0 : 1));
-        m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_textDirection, pValue);
+        m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_bidi, pValue);
     }
     break;
     case RTF_LTRROW:


More information about the Libreoffice-commits mailing list