sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 10 ++++++++++ sw/source/filter/ww8/wrtw8nds.cxx | 4 ++++ 3 files changed, 14 insertions(+)
New commits: commit b524cab24b8f7c39104db7842e071599eb1d674f Author: Justin Luth <justin_l...@sil.org> AuthorDate: Fri Jan 25 19:56:54 2019 +0300 Commit: Justin Luth <justin_l...@sil.org> CommitDate: Sat Mar 16 08:12:46 2019 +0100 tdf#98620 filter\ww8 export: spam Jc if environment defines BiDi If the BiDi value value comes from the page style, then MS formats have no idea what to do with it, so those values are written out into the paragraph itself. Since Justify is highly dependent on BiDi in order to understand its meaning, it also needs to be spammed. Change-Id: I7407056573bb115e8bab2dce0070b0a718dcc1eb Reviewed-on: https://gerrit.libreoffice.org/66923 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_l...@sil.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt b/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt new file mode 100644 index 000000000000..ae675b82ffbd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 08e0480e1322..a846bf70636d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -14,6 +14,7 @@ #include <com/sun/star/style/BreakType.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/table/BorderLine.hpp> +#include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/XDependentTextField.hpp> #include <com/sun/star/text/XFootnote.hpp> #include <com/sun/star/text/XPageCursor.hpp> @@ -653,6 +654,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf119760_positionCellBorder, "tdf119760_positionCe CPPUNIT_ASSERT( nRowLeft < nTextLeft ); } +DECLARE_OOXMLEXPORT_TEST(testTdf98620_environmentBiDi, "tdf98620_environmentBiDi.odt") +{ + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>( getParagraph(1), "WritingMode" )); + CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_RIGHT), getProperty<sal_Int32>( getParagraph(1), "ParaAdjust" )); + + CPPUNIT_ASSERT_EQUAL(text::WritingMode2::LR_TB, getProperty<sal_Int16>( getParagraph(2), "WritingMode" )); + CPPUNIT_ASSERT_EQUAL(sal_Int32(style::ParagraphAdjust_RIGHT), getProperty<sal_Int32>( getParagraph(2), "ParaAdjust" )); +} + DECLARE_OOXMLEXPORT_TEST(testTdf116976, "tdf116976.docx") { // This was 0, relative size of shape after bitmap was ignored. diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index b73fe1754c1f..41d8dc3072d6 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2759,6 +2759,10 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) pTmpSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_RL_TB, RES_FRAMEDIR)); else pTmpSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR)); + + const SvxAdjustItem* pAdjust = rNode.GetSwAttrSet().GetItem(RES_PARATR_ADJUST); + if ( pAdjust && (pAdjust->GetAdjust() == SvxAdjust::Left || pAdjust->GetAdjust() == SvxAdjust::Right ) ) + pTmpSet->Put( *pAdjust, RES_PARATR_ADJUST ); } // move code for handling of numbered, // but not counted paragraphs to this place. Otherwise, the paragraph _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits