summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-04-04 13:16:02 +0200
committerroot <root@linux-3qg3.site>2014-04-04 19:06:11 +0200
commit8416261a8b809a53058cd7970228012a8b3fb06d (patch)
treec012d0d40ef5a0f7725fb3fd373f2dbdf7b6bdf6 /xmloff
parentf470f3c72efb3fad109e62247c4d0abebc359345 (diff)
Use stored mime type for stream creation
Change-Id: Iecc50f7964fa63ae028e2fb21d022de1f060c7a7
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/shapeexport.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 912f8c1e22db..13d1f77b6e09 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -3085,7 +3085,7 @@ void XMLShapeExport::ImpExportPluginShape(
static void lcl_CopyStream(
uno::Reference<io::XInputStream> const& xInStream,
uno::Reference<embed::XStorage> const& xTarget,
- OUString const& rPath)
+ OUString const& rPath, const OUString& rMimeType)
{
::comphelper::LifecycleProxy proxy;
uno::Reference<io::XStream> const xStream(
@@ -3104,10 +3104,7 @@ static void lcl_CopyStream(
if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage
xStreamProps->setPropertyValue(
OUString("MediaType"),
- uno::makeAny(OUString(
- //FIXME how to detect real media type?
- //but currently xmloff has this one hardcoded anyway...
- "application/vnd.sun.star.media")));
+ uno::makeAny(rMimeType));
xStreamProps->setPropertyValue( // turn off compression
OUString("Compressed"),
uno::makeAny(sal_False));
@@ -3120,7 +3117,7 @@ static void lcl_CopyStream(
static OUString
lcl_StoreMediaAndGetURL(SvXMLExport & rExport,
uno::Reference<beans::XPropertySet> const& xPropSet,
- OUString const& rURL)
+ OUString const& rURL, const OUString& rMimeType)
{
OUString urlPath;
if (rURL.startsWithIgnoreAsciiCase("vnd.sun.star.Package:", &urlPath))
@@ -3140,7 +3137,7 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport,
return OUString();
}
- lcl_CopyStream(xInStream, xTarget, rURL);
+ lcl_CopyStream(xInStream, xTarget, rURL, rMimeType);
return urlPath;
}
@@ -3225,8 +3222,11 @@ void XMLShapeExport::ImpExportMediaShape(
// export media url
OUString aMediaURL;
xPropSet->getPropertyValue("MediaURL") >>= aMediaURL;
+ OUString sMimeType;
+ xPropSet->getPropertyValue("MediaMimeType") >>= sMimeType;
+
OUString const persistentURL =
- lcl_StoreMediaAndGetURL(GetExport(), xPropSet, aMediaURL);
+ lcl_StoreMediaAndGetURL(GetExport(), xPropSet, aMediaURL, sMimeType);
if( aMediaURL.endsWith(".json") )
lcl_StoreJsonExternals(GetExport(), aMediaURL);
@@ -3236,8 +3236,6 @@ void XMLShapeExport::ImpExportMediaShape(
mrExport.AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONLOAD );
// export mime-type
- OUString sMimeType;
- xPropSet->getPropertyValue("MediaMimeType") >>= sMimeType;
mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_MIME_TYPE, sMimeType );
// write plugin