diff options
author | Serge Krot <Serge.Krot@cib.de> | 2018-04-04 14:06:00 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-04-05 07:57:33 +0200 |
commit | bc906ec69d47ecde13ddf63cf3d366ec89055cfe (patch) | |
tree | 780b1b3f7234c499cf0e39c2e100082900f2e1b2 /xmloff | |
parent | 717e0853dce50c33b61ea8541d24186e40e84c73 (diff) |
tdf#116266: Take into account file extension when image type is unknown
For external images there is no always exists image type,
we need to take into account the file extension to determine
its mime type.
Added unit test.
Change-Id: I884ae18939b6def683bb318260c4e195da5bb252
Reviewed-on: https://gerrit.libreoffice.org/52375
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlmultiimagehelper.cxx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/xmloff/source/core/xmlmultiimagehelper.cxx b/xmloff/source/core/xmlmultiimagehelper.cxx index c0e437c1f370..7213a5090f54 100644 --- a/xmloff/source/core/xmlmultiimagehelper.cxx +++ b/xmloff/source/core/xmlmultiimagehelper.cxx @@ -33,17 +33,12 @@ namespace { sMimeType = comphelper::GraphicMimeTypeHelper::GetMimeTypeForImageUrl(rString); } - else if (rString.startsWith("vnd.sun.star.Package")) + else // if (rString.startsWith("vnd.sun.star.Package")) { sMimeType = comphelper::GraphicMimeTypeHelper::GetMimeTypeForExtension(OUStringToOString( rString.copy(rString.lastIndexOf(".") + 1), RTL_TEXTENCODING_ASCII_US)); } - else - { - SAL_WARN("xmloff", "Unknown image source: " << rString); - return 0; - } // pixel formats first if(sMimeType == "image/bmp") |