diff options
author | Zolnai Tamás <tamas.zolnai@collabora.com> | 2014-04-04 13:14:45 +0200 |
---|---|---|
committer | root <root@linux-3qg3.site> | 2014-04-04 19:06:11 +0200 |
commit | f470f3c72efb3fad109e62247c4d0abebc359345 (patch) | |
tree | f3a7969c13bae5d43ba5bc09935117c78deb5742 /xmloff | |
parent | 97b20c9deee46195357896197440cc1cc43d3452 (diff) |
Introduce a new media shape property to handle mime type
Default mime-type for all media objects:
"application/vnd.sun.star.media"
The problem of missing mime-type detection
still exists. For now only glTF model has
a concrete type.
Change-Id: I4dca26c1c47a564579bbed926bffa3aa5eda6c04
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 2 |
2 files changed, 5 insertions, 10 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 3a24c71e0378..912f8c1e22db 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -3205,15 +3205,6 @@ static void lcl_StoreJsonExternals( } } -static OUString lcl_GetMimeType(const OUString& aMediaURL) -{ - // TODO: Find a better way to find out the mime type, maybe via propset - if( aMediaURL.endsWith(".json") ) - return OUString("application/vnd.gltf+json"); - else - return OUString("application/vnd.sun.star.media"); -} - void XMLShapeExport::ImpExportMediaShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint) @@ -3245,7 +3236,9 @@ void XMLShapeExport::ImpExportMediaShape( mrExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD ); // export mime-type - mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIME_TYPE, lcl_GetMimeType(aMediaURL) ); + OUString sMimeType; + xPropSet->getPropertyValue("MediaMimeType") >>= sMimeType; + mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIME_TYPE, sMimeType ); // write plugin SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_PLUGIN, !( nFeatures & SEF_EXPORT_NO_WS ), true); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index aefffce441c4..902c1799ed43 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -3206,6 +3206,8 @@ void SdXMLPluginShapeContext::EndElement() OUString("MediaURL"), uno::makeAny(maHref)); + xProps->setPropertyValue("MediaMimeType", uno::makeAny(maMimeType) ); + for( sal_Int32 nParam = 0; nParam < maParams.getLength(); ++nParam ) { const OUString& rName = maParams[ nParam ].Name; |