summaryrefslogtreecommitdiff
path: root/oox/source/vml/vmltextbox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/vml/vmltextbox.cxx')
-rw-r--r--oox/source/vml/vmltextbox.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx
index 6fe51b147f0d..4f03f7595ac0 100644
--- a/oox/source/vml/vmltextbox.cxx
+++ b/oox/source/vml/vmltextbox.cxx
@@ -20,8 +20,10 @@
#include "oox/vml/vmltextbox.hxx"
#include <rtl/ustrbuf.hxx>
+#include <svx/unopage.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>
@@ -91,6 +93,15 @@ void TextBox::convert(uno::Reference<drawing::XShape> xShape) const
aPropertyValue.Value = uno::makeAny(double(rFont.monSize.get()) / 2.);
aPropVec.push_back(aPropertyValue);
}
+ if (rFont.monSpacing.has())
+ {
+ aPropertyValue.Name = "CharKerning";
+ // Value is not converted to mm100: SvxKerningItem::PutValue() gets
+ // called with nMemberId = 0, so no mm100 -> twips conversion will
+ // be done there.
+ aPropertyValue.Value = uno::makeAny(sal_Int16(rFont.monSpacing.get()));
+ aPropVec.push_back(aPropertyValue);
+ }
if (rParagraph.moParaAdjust.has())
{
style::ParagraphAdjust eAdjust = style::ParagraphAdjust_LEFT;
@@ -126,6 +137,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 ) );
}
}