Kaydet (Commit) 6bf79576 authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#46361 oox: VML import of v-text-anchor for drawinglayer shapes

Change-Id: Ib73d17fd8c9325f7f062d4a15b655e36b84bd351
üst f24e4c74
......@@ -96,6 +96,7 @@ struct OOX_DLLPUBLIC ShapeTypeModel
OptValue< OUString > moWrapAnchorY; ///< The base object from which our vertical positioning should be calculated.
OptValue< ::rtl::OUString > moWrapType; ///< How to wrap the text around the object
OptValue< ::rtl::OUString > moWrapSide; ///< On which side to wrap the text around the object
OUString maVTextAnchor; ///< How the text inside the shape is anchored vertically.
explicit ShapeTypeModel();
......
......@@ -27,6 +27,7 @@
#include <com/sun/star/awt/XControlModel.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
......@@ -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);
}
......
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment