diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-09-04 14:14:39 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-11-28 11:54:17 +0100 |
commit | 082cdbc991a2e31556bab53a5b8214cb89138354 (patch) | |
tree | 44eb08e6298928643455ada1435f7ca9383c331d /xmloff | |
parent | 913f77dc5af13d5ceabf5c9fac2a870ebb7ccdea (diff) |
tdf#109202: Convert images to desired format in (f)odt filter
Pass down mimetype to SvXMLGraphicHelper
Change-Id: I9c81c06d2a1d6168704440094081e99d0bcbbff9
Reviewed-on: https://gerrit.libreoffice.org/41893
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 33cd48a9982c..f8970a58f2c2 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2451,6 +2451,10 @@ bool SvXMLExport::SetNullDateOnUnitConverter() return mpImpl->mbNullDateInitialized; } +OUString SvXMLExport::GetImageFilterName() const +{ + return msImgFilterName; +} void SvXMLElementExport::StartElement( const sal_uInt16 nPrefixKey, 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); { |