summaryrefslogtreecommitdiff
path: root/oox/source/export/drawingml.cxx
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2017-09-06 11:54:33 +0200
committerJan Holesovsky <kendy@collabora.com>2017-09-07 07:01:44 +0200
commit4aabc5164d2a0d84e22fb3f6f66e020a8df6899a (patch)
treeb8bef6ca91097f54771d80016490c444ac1b1e7a /oox/source/export/drawingml.cxx
parent4d1159136ae25b437d874e0fba7f0f13651049b6 (diff)
tdf#106867: Unit test for the export of embedded videos.
Change-Id: Ibbc3da56ace2eaaf4670e869a34ec4c1bad4bf5d Reviewed-on: https://gerrit.libreoffice.org/41982 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'oox/source/export/drawingml.cxx')
-rw-r--r--oox/source/export/drawingml.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index fe5f4c3268da..44cfc48ad089 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -967,12 +967,24 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra
bool bEmbed = rURL.startsWith("vnd.sun.star.Package:");
// mime type
- // TODO add more types explicitly based on the extension (?)
- OUString aMimeType;
- if (aExtension.equalsIgnoreAsciiCase(".wmv"))
- aMimeType = "video/x-ms-wmv";
- else
- aMimeType = pMediaObj->getMediaProperties().getMimeType();
+ OUString aMimeType(pMediaObj->getMediaProperties().getMimeType());
+ if (aMimeType == "application/vnd.sun.star.media")
+ {
+ // try to set something better
+ // TODO fix the importer to actually set the mimetype on import
+ if (aExtension.equalsIgnoreAsciiCase(".avi"))
+ aMimeType = "video/x-msvideo";
+ else if (aExtension.equalsIgnoreAsciiCase(".flv"))
+ aMimeType = "video/x-flv";
+ else if (aExtension.equalsIgnoreAsciiCase(".mp4"))
+ aMimeType = "video/mp4";
+ else if (aExtension.equalsIgnoreAsciiCase(".mov"))
+ aMimeType = "video/quicktime";
+ else if (aExtension.equalsIgnoreAsciiCase(".ogv"))
+ aMimeType = "video/ogg";
+ else if (aExtension.equalsIgnoreAsciiCase(".wmv"))
+ aMimeType = "video/x-ms-wmv";
+ }
OUString aVideoFileRelId;
OUString aMediaRelId;