summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdomedia.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-04-05 11:50:44 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-04-05 14:34:51 +0200
commita5225ba82e94a549f44420f56a7cb9d7906561cc (patch)
tree084be80b91028e3bfbe8cd5e3b50ba97fa8b516d /svx/source/svdraw/svdomedia.cxx
parent8b4af1eb0549b6832361da85ddaa1e13be34ec76 (diff)
avmedia,*: guess the mime type of media files based on file name
.. at least for the most popular types, and do it automatically in MediaItem::setURL(). This should work in practice in most cases and is much simpler than adding some type detection or calling into platform dependent avmedia backends. Remove the parameter that was only ever set to "application/vnd.sun.star.media" anyway, the same value that would be used if it's missing. Stop using that silly type for everything, only use it when guessing fails. In case an ODF document is loaded, it will use the mime type loaded from the file (see setting of MediaMimeType in SdXMLPluginShapeContext) and not guess it because that would require updating the entry in manifest.xml as well. Change-Id: I8ce29cf7425678ae11dda1d8c875be818f8623af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150049 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'svx/source/svdraw/svdomedia.cxx')
-rw-r--r--svx/source/svdraw/svdomedia.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index 17785a5d693a..73b19ca78773 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -252,12 +252,10 @@ void SdrMediaObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrin
SetLogicRect( tools::Rectangle( aPos, aSize ) );
}
-void SdrMediaObj::setURL( const OUString& rURL, const OUString& rReferer, const OUString& rMimeType )
+void SdrMediaObj::setURL(const OUString& rURL, const OUString& rReferer)
{
::avmedia::MediaItem aURLItem;
#if HAVE_FEATURE_AVMEDIA
- if( !rMimeType.isEmpty() )
- m_xImpl->m_MediaProperties.setMimeType(rMimeType);
aURLItem.setURL( rURL, "", rReferer );
#else
(void) rMimeType;