diff options
Diffstat (limited to 'xmloff/source/text/txtparae.cxx')
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index ccbb11b4d2c2..4ab345e599c3 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -118,6 +118,7 @@ #include <algorithm> #include <iterator> #include <comphelper/processfactory.hxx> +#include <comphelper/graphicmimetype.hxx> using namespace ::std; using namespace ::com::sun::star; @@ -3096,8 +3097,16 @@ void XMLTextParagraphExport::_exportTextGraphic( sGrfFilter ); // Add mimetype to make it easier for readers to get the base64 image type right, tdf#109202 - OUString aSourceMimeType = getMimeType(sOrigURL); - if ( !aSourceMimeType.isEmpty() ) + // do we have a hard export image filter set? then that's our mimetype + OUString aSourceMimeType = GetExport().GetImageFilterName(); + // otherwise determine mimetype from graphic + if ( aSourceMimeType.isEmpty() ) + aSourceMimeType = getMimeType(sOrigURL); + else // !aSourceMimeType.isEmpty() + { + const OString aExt( OUStringToOString( aSourceMimeType, RTL_TEXTENCODING_ASCII_US ) ); + aSourceMimeType = comphelper::GraphicMimeTypeHelper::GetMimeTypeForExtension( aExt ); + } GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "mime-type", aSourceMimeType); { |