diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-17 10:44:47 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-04-22 19:31:49 +0000 |
commit | 502e606c84666df66fa1b099ae4147220f262841 (patch) | |
tree | 45435ae02792e674fae1b02ec94d2a653b0ab759 | |
parent | 7ceeb2fbab10701f3802eb26e6a30cbd743459fe (diff) |
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@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf86182.rtf | 4 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf86182.rtf b/sw/qa/extras/rtfimport/data/tdf86182.rtf new file mode 100644 index 000000000000..d63c48934a97 --- /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 8dce8eea9836..6c52362c0bda 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 d5895986dd36..ad9954bc795a 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: |