diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-05-25 18:54:37 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-05-28 11:29:17 +0200 |
commit | 46edac18b76d8e9cc74aed8a9712ca3bdadd0972 (patch) | |
tree | a08cce863e02fc8bb163c7e30699d52fd2cbcae7 /oox | |
parent | ba5a9132375bcfedebd7c3d2500006161800da3b (diff) |
Watermark: VML font-family import for textpath
Handle style attribute to get font-family:
<v:textpath style="font-family:"DejaVu Sans Light";font-size:1pt" .../>
Change-Id: I5fe530aecccc57e103b413ef494502f666f1005a
Reviewed-on: https://gerrit.libreoffice.org/38039
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/vml/vmlformatting.cxx | 22 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index f8c8de8dae8d..c2e2d139c0d6 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -882,6 +882,28 @@ void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Referen } rPropMap.setAnyProperty(PROP_CustomShapeGeometry, uno::makeAny(aGeomPropSeq)); } + if (moStyle.has()) + { + OUString aStyle = moStyle.get(OUString()); + + sal_Int32 nIndex = 0; + while( nIndex >= 0 ) + { + OUString aName, aValue; + if (ConversionHelper::separatePair(aName, aValue, aStyle.getToken(0, ';', nIndex), ':')) + { + if (aName == "font-family") + { + // remove " (first, and last character) + if (aValue.getLength() > 2) + aValue = aValue.copy(1, aValue.getLength() - 2); + + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + xPropertySet->setPropertyValue("CharFontName", uno::makeAny(aValue)); + } + } + } + } } } // namespace vml diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index ed369ae1c7d9..02cf06e51429 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -383,6 +383,7 @@ ContextHandlerRef ShapeTypeContext::onCreateContext( sal_Int32 nElement, const A break; case VML_TOKEN( textpath ): mrTypeModel.maTextpathModel.moString.assignIfUsed(rAttribs.getString(XML_string)); + mrTypeModel.maTextpathModel.moStyle.assignIfUsed(rAttribs.getString(XML_style)); break; } return nullptr; |