From 6ceeb0df6987bb7f70423b473b31eec54526481d Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Sun, 28 Sep 2014 21:31:08 +0200 Subject: proper reading of mso-position-(horizontal|vertical)(-relative) Change-Id: I50f537c697f6e73c1fd150f3f03fc65b85ccbeaf --- oox/source/vml/vmlshape.cxx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'oox/source/vml/vmlshape.cxx') diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 7c5bc5ce04e1..1c826a1ee971 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -473,12 +473,38 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) { if ( rTypeModel.maPositionHorizontal == "center" ) rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::CENTER)); + else if ( rTypeModel.maPositionHorizontal == "left" ) + rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::LEFT)); + else if ( rTypeModel.maPositionHorizontal == "right" ) + rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::RIGHT)); + else if ( rTypeModel.maPositionHorizontal == "inside" ) + { + rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::LEFT)); + rPropSet.setAnyProperty(PROP_PageToggle, makeAny(sal_True)); + } + else if ( rTypeModel.maPositionHorizontal == "outside" ) + { + rPropSet.setAnyProperty(PROP_HoriOrient, makeAny(text::HoriOrientation::RIGHT)); + rPropSet.setAnyProperty(PROP_PageToggle, makeAny(sal_True)); + } if ( rTypeModel.maPositionHorizontalRelative == "page" ) rPropSet.setAnyProperty(PROP_HoriOrientRelation, makeAny(text::RelOrientation::PAGE_FRAME)); + else if ( rTypeModel.maPositionVerticalRelative == "margin" ) + rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::PAGE_PRINT_AREA); + else if ( rTypeModel.maPositionVerticalRelative == "text" ) + rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::FRAME); if ( rTypeModel.maPositionVertical == "center" ) rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::CENTER)); + else if ( rTypeModel.maPositionVertical == "top" ) + rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::TOP)); + else if ( rTypeModel.maPositionVertical == "bottom" ) + rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::BOTTOM)); + else if ( rTypeModel.maPositionVertical == "inside" ) + rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::LINE_TOP)); + else if ( rTypeModel.maPositionVertical == "outside" ) + rPropSet.setAnyProperty(PROP_VertOrient, makeAny(text::VertOrientation::LINE_BOTTOM)); if ( rTypeModel.maPosition == "absolute" ) { @@ -495,7 +521,6 @@ void lcl_SetAnchorType(PropertySet& rPropSet, const ShapeTypeModel& rTypeModel) } else { - // Vertical placement relative to margin, because parent style must not modify vertical position rPropSet.setProperty(PROP_VertOrientRelation, text::RelOrientation::FRAME); } } -- cgit