summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-07-01 13:15:54 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-07-02 11:55:42 +0200
commit6bf79576aeca243db553ed3b5eade492dc35337b (patch)
tree88b6d0a0efb627be0ae1d12e966de9b767a9228d /oox
parentf24e4c74d7d6a7d95090c6fa6a584fed7787706c (diff)
fdo#46361 oox: VML import of v-text-anchor for drawinglayer shapes
Change-Id: Ib73d17fd8c9325f7f062d4a15b655e36b84bd351
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmlshape.cxx9
-rw-r--r--oox/source/vml/vmlshapecontext.cxx1
2 files changed, 10 insertions, 0 deletions
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 <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);
}
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;
}
}
}