diff options
author | Serge Krot <Serge.Krot@cib.de> | 2018-04-04 14:06:00 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-04-12 10:53:19 +0200 |
commit | bd9e43281b3baabd343f0199702bcd748cbbc9a6 (patch) | |
tree | cd385a3a71c2a26c0f1875bd2c74230ce444952f /xmloff | |
parent | bc7542a88d3173fed3ff17219c3a0aacb1581991 (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.
Reviewed-on: https://gerrit.libreoffice.org/52375
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit bc906ec69d47ecde13ddf63cf3d366ec89055cfe)
Change-Id: I884ae18939b6def683bb318260c4e195da5bb252
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") |