From 975875c97b8617c883d3f02e48def960f2419695 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 6 Sep 2013 15:57:03 +0200 Subject: bnc#779642 VML import: handle drawinglayer rectangle char spacing Change-Id: I79fa72c9235682030d23a03fdb0c7c40370c4a8a (cherry picked from commit 4cbc41bc4eaa822829e68c1ee11eafe834bb7da7) --- oox/source/vml/vmltextbox.cxx | 10 ++++++++++ oox/source/vml/vmltextboxcontext.cxx | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'oox/source') diff --git a/oox/source/vml/vmltextbox.cxx b/oox/source/vml/vmltextbox.cxx index 1fbed35da66a..7878505d0845 100644 --- a/oox/source/vml/vmltextbox.cxx +++ b/oox/source/vml/vmltextbox.cxx @@ -20,6 +20,7 @@ #include "oox/vml/vmltextbox.hxx" #include +#include #include #include #include @@ -90,6 +91,15 @@ void TextBox::convert(uno::Reference 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; diff --git a/oox/source/vml/vmltextboxcontext.cxx b/oox/source/vml/vmltextboxcontext.cxx index e176db441abc..c37d904374cf 100644 --- a/oox/source/vml/vmltextboxcontext.cxx +++ b/oox/source/vml/vmltextboxcontext.cxx @@ -133,6 +133,16 @@ void TextPortionContext::onStartElement(const AttributeList& rAttribs) case OOX_TOKEN(doc, color): maFont.moColor = rAttribs.getString( OOX_TOKEN(doc, val) ); break; + case OOX_TOKEN(doc, spacing): + maFont.monSpacing = rAttribs.getInteger(OOX_TOKEN(doc, val)); + break; + case OOX_TOKEN(doc, r): + case OOX_TOKEN(doc, rPr): + case OOX_TOKEN(doc, t): + break; + default: + SAL_INFO("oox", "unhandled: 0x" << std::hex<< getCurrentElement()); + break; } } -- cgit v1.2.3