diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-12-02 16:57:30 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-12-02 11:10:34 +0100 |
commit | f5cf0c10eb7050feff19190b06b4597aab2d400a (patch) | |
tree | 31d51383a991194f5d6877db8a83344e988ec2d7 /xmloff/inc | |
parent | e320518eaf4c402bbbb37ed564e645659165f4f7 (diff) |
tdf#123396 actually use the mimetype set in the from document
In the document we set the mime type for the images stored, but
at import we never actually used the mime types. We always did
mime type detection from the filename extension. The problem with
this is that files stored as base64 streams don't have a filename
so it is also not possible to determine the mime type from the
file name.
The consequence of this is that we can't know which image to take
if we have multiple images (fallback images) so we always take the
last one, which could be the wrong one. This happend in the test
document.
This changes the behavior so that we always first use the document
set mime type as there is no reason to not trust that. Only if the
mime type isn't provided by the document we use other mime type
detection methods.
Change-Id: I175c509ce5f11eab2c0454d4d9901ca1fe975272
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160237
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmloff/inc')
-rw-r--r-- | xmloff/inc/xmlmultiimagehelper.hxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/xmloff/inc/xmlmultiimagehelper.hxx b/xmloff/inc/xmlmultiimagehelper.hxx index adfdce2e9285..b55e59324ed4 100644 --- a/xmloff/inc/xmlmultiimagehelper.hxx +++ b/xmloff/inc/xmlmultiimagehelper.hxx @@ -32,6 +32,7 @@ protected: /// helper to get the created xShape instance, override this virtual void removeGraphicFromImportContext(const SvXMLImportContext& rContext) = 0; virtual OUString getGraphicPackageURLFromImportContext(const SvXMLImportContext& rContext) const = 0; + virtual OUString getMimeTypeFromImportContext(const SvXMLImportContext& rContext) const = 0; virtual css::uno::Reference<css::graphic::XGraphic> getGraphicFromImportContext(const SvXMLImportContext& rContext) const = 0; public: |