summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-09-05 14:24:02 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-05 14:48:01 +0200
commitb10afb26296e33c77e94a6eda3f2c36c4d34c2aa (patch)
treef4543d1c27301ac00f325e189ad4872300b86cf7 /oox
parent8c1d8ab99ca593189b25e6d8e56ed65c2482b09d (diff)
bnc#779642 VML import: fix TextHorizontalAdjust when layout-flow is vertical
The shape had no special properties about hori/vert text adjustment, so it should be hori left / vert top. Then it has vertical layout-flow, so vert should be top and hori should be right (vert was center). Change-Id: Ia89d8587b6a822ead45198dc5d1ba23907cc3567
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmltextbox.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx
index e3d07b8099ff..553b6f05a34c 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -22,6 +22,7 @@
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/awt/FontWeight.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/text/XTextAppend.hpp>
#include <com/sun/star/text/WritingMode.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
@@ -126,6 +127,16 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const
if ( maLayoutFlow == "vertical" )
{
uno::Reference<beans::XPropertySet> xProperties(xShape, uno::UNO_QUERY);
+
+ // VML has the text horizontally aligned to left (all the time),
+ // v-text-anchor for vertical alignment, and vertical mode to swap the
+ // two. drawinglayer supports both horizontal and vertical alignment,
+ // but no vertical mode: we use T->B, R->L instead.
+ // As a result, we need to set horizontal adjustment here to 'right',
+ // that will result in vertical 'top' after writing mode is applied,
+ // which matches the VML behavior.
+ xProperties->setPropertyValue("TextHorizontalAdjust", uno::makeAny(drawing::TextHorizontalAdjust_RIGHT));
+
xProperties->setPropertyValue( "TextWritingMode", uno::makeAny( text::WritingMode_TB_RL ) );
}
}