From 6bf79576aeca243db553ed3b5eade492dc35337b Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 1 Jul 2013 13:15:54 +0200 Subject: fdo#46361 oox: VML import of v-text-anchor for drawinglayer shapes Change-Id: Ib73d17fd8c9325f7f062d4a15b655e36b84bd351 --- oox/source/vml/vmlshape.cxx | 9 +++++++++ oox/source/vml/vmlshapecontext.cxx | 1 + 2 files changed, 10 insertions(+) (limited to 'oox') diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 1cb47724c140..f95b7e1f4244 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -560,6 +561,14 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes } } + // drawinglayer default is center, MSO default is top. + drawing::TextVerticalAdjust eTextVerticalAdjust = drawing::TextVerticalAdjust_TOP; + if (maTypeModel.maVTextAnchor == "middle") + eTextVerticalAdjust = drawing::TextVerticalAdjust_CENTER; + else if (maTypeModel.maVTextAnchor == "bottom") + eTextVerticalAdjust = drawing::TextVerticalAdjust_BOTTOM; + PropertySet(xShape).setAnyProperty(PROP_TextVerticalAdjust, makeAny(eTextVerticalAdjust)); + if (getTextBox()) getTextBox()->convert(xShape); } diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index efa6e3888cbe..3c47c668cd39 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -417,6 +417,7 @@ void ShapeTypeContext::setStyle( const OUString& rStyle ) else if( aName.equalsAscii( "visibility" ) ) mrTypeModel.mbVisible = !aValue.equalsAscii( "hidden" ); else if( aName == "mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue; + else if ( aName == "v-text-anchor" ) mrTypeModel.maVTextAnchor = aValue; } } } -- cgit