summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-05-31 00:03:06 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2017-06-16 14:22:15 +0200
commit9a7ae73f17cbb20850f8e5ffc87123334be67e49 (patch)
treececd6ca18915161da2d6a3f141739fc55fc3f813 /oox
parent6ed8f8ac59c06a7a1bccf603fe6d4c834ff96eaf (diff)
Watermark: VML export/import font size
Change-Id: I11409dfc621018a761c70a640938e18ae679d3f5 Reviewed-on: https://gerrit.libreoffice.org/38254 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit f6f52c526cda640dd7595abd45727cb615c2b167) Reviewed-on: https://gerrit.libreoffice.org/38872 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/vmlexport.cxx7
-rw-r--r--oox/source/vml/vmlformatting.cxx12
-rw-r--r--oox/source/vml/vmlshape.cxx2
3 files changed, 19 insertions, 2 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 623beaaa88ec..a7420b560beb 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -812,6 +812,13 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
OUString aTextPathFont = SvxMSDffManager::MSDFFReadZString(aStream, aFont.nPropSize, true);
aStyle += "font-family:\"" + aTextPathFont + "\"";
}
+ sal_uInt32 nSize;
+ if (rProps.GetOpt(ESCHER_Prop_gtextSize, nSize))
+ {
+ float nSizeF = (sal_Int32)nSize / 65536;
+ OUString aSize = OUString::number(nSizeF);
+ aStyle += ";font-size:" + aSize + "pt";
+ }
if (!aStyle.isEmpty())
pAttrList->add(XML_style, OUStringToOString(aStyle, RTL_TEXTENCODING_UTF8));
m_pSerializer->singleElementNS(XML_v, XML_textpath, XFastAttributeListRef(pAttrList));
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index c2e2d139c0d6..2992a185b82a 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -855,7 +855,7 @@ beans::PropertyValue lcl_createTextpathProps()
return aRet;
}
-void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Reference<drawing::XShape>& xShape) const
+void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Reference<drawing::XShape>& xShape, const GraphicHelper& rGraphicHelper) const
{
if (moString.has())
{
@@ -901,6 +901,16 @@ void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Referen
uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
xPropertySet->setPropertyValue("CharFontName", uno::makeAny(aValue));
}
+ else if (aName == "font-size")
+ {
+ oox::OptValue<OUString> aOptString(aValue);
+ sal_Int64 nEmu = lclGetEmu( rGraphicHelper, aOptString, 1 );
+ // 1 point = 1/72 inch = 12,700 EMU
+ float nSize = nEmu / 12700;
+
+ uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
+ xPropertySet->setPropertyValue("CharHeight", uno::makeAny(nSize));
+ }
}
}
}
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index badcc23f0392..c89b5ece1934 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -519,7 +519,7 @@ void ShapeBase::convertShapeProperties( const Reference< XShape >& rxShape ) con
}
}
else if (xSInfo->supportsService("com.sun.star.drawing.CustomShape"))
- maTypeModel.maTextpathModel.pushToPropMap(aPropMap, rxShape);
+ maTypeModel.maTextpathModel.pushToPropMap(aPropMap, rxShape, rGraphicHelper);
PropertySet( rxShape ).setProperties( aPropMap );
}