diff options
author | Justin Luth <justin_luth@sil.org> | 2017-09-18 18:33:13 -0400 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2017-12-16 17:46:59 +0100 |
commit | 610d98bd93e8032b9bfb48dc2ed0cd4d35c23ddd (patch) | |
tree | e399c87f2e6e1d9fd622f69bf5ba79db5b4e99b7 | |
parent | aeab23841d3c883b4ea2b8e3143eabd5ac440276 (diff) |
tdf#97648 ooxmlimport: horizontal line's horiOrient
Although LO won't visually do anything with this property
(because o:hr is improperly imported AS_CHAR), at least
import and assign the property so that it is there for
the future if o:hr is changed from AS_CHAR to AT_*.
The unit test just adds a test for the existing status - to
highlight what still needs to be fixed.
o:hr probably ought to be AT_CHAR, with no wrapping. However,
simply doing that wraps text the wrong way (always underneath)
which seems to be a LO limitation of not putting preceeding
chars above an AT_CHAR fly. So that's why I'm not implementing
a change to AT_CHAR.
Change-Id: I4aec99d3976c6d461715dba304cdf9ad98ab12b6
Reviewed-on: https://gerrit.libreoffice.org/42440
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 18dc68dbc2f5..d1237eb8615d 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -310,6 +310,8 @@ ShapeTypeContext::ShapeTypeContext(ContextHandler2Helper const & rParent, mrTypeModel.maWidthPercent = OUString::number( hrpct.toInt32() ); mrTypeModel.maWrapDistanceLeft = "0"; mrTypeModel.maWrapDistanceRight = "0"; + mrTypeModel.maPositionHorizontal = rAttribs.getString( O_TOKEN( hralign ), "left" ); + mrTypeModel.moWrapType = "topAndBottom"; } // stroke settings (may be overridden by v:stroke element later) diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index bbcaf277cb79..86785a00bff0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/style/LineSpacing.hpp> #include <com/sun/star/style/LineSpacingMode.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/drawing/XControlShape.hpp> #include <ftninfo.hxx> @@ -231,9 +232,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97648_relativeWidth,"tdf97648_relativeWidth.docx CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(7616), getShape(1)->getSize().Width, 10); CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(8001), getShape(2)->getSize().Width, 10); CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(4001), getShape(3)->getSize().Width, 10); + CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_LEFT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(6), "ParaAdjust")) ); CPPUNIT_ASSERT_DOUBLES_EQUAL( sal_Int32(1600), getShape(4)->getSize().Width, 10); + CPPUNIT_ASSERT_EQUAL( style::ParagraphAdjust_RIGHT, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(8), "ParaAdjust")) ); + CPPUNIT_ASSERT_EQUAL( sal_Int32(0), getProperty<sal_Int32>(getShape(1), "LeftMargin") ); + if (!mbExported) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE("Text should wrap above/below the line", text::WrapTextMode_NONE, getProperty<text::WrapTextMode>(getShape(1), "Surround")); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(2), "HoriOrient")); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::RIGHT, getProperty<sal_Int16>(getShape(3), "HoriOrient")); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT, getProperty<sal_Int16>(getShape(4), "HoriOrient")); + } } DECLARE_OOXMLEXPORT_TEST(testTdf104061_tableSectionColumns,"tdf104061_tableSectionColumns.docx") |