diff options
author | Justin Luth <justin_luth@sil.org> | 2019-01-25 19:56:54 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2019-03-16 08:12:46 +0100 |
commit | b524cab24b8f7c39104db7842e071599eb1d674f (patch) | |
tree | 183a9ab3ac29fea1e5b8b5f2f56c40ee70b44c23 /sw | |
parent | 97b78d77ebaf6ba676d777454c6c957a87324f12 (diff) |
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_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt | bin | 0 -> 9321 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt b/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt Binary files differnew file mode 100644 index 000000000000..ae675b82ffbd --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf98620_environmentBiDi.odt 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 |