summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-05-25 18:54:37 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2017-06-04 14:38:08 +0200
commit7d723184dd7f77cb16d3073afa0f9ed47c6598ea (patch)
treed9ab9dd3a1fef89d901618973085f581858162b1 /oox
parenta5f911f04f986d424df5393fb9a2744fdf770f21 (diff)
Watermark: VML font-family import for textpath
Handle style attribute to get font-family: <v:textpath style="font-family:&quot;DejaVu Sans Light&quot;;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> (cherry picked from commit 46edac18b76d8e9cc74aed8a9712ca3bdadd0972) Reviewed-on: https://gerrit.libreoffice.org/38384 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/vml/vmlformatting.cxx22
-rw-r--r--oox/source/vml/vmlshapecontext.cxx1
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;