svtools/source/graphic/descriptor.cxx | 1 + svtools/source/graphic/descriptor.hxx | 1 + sw/qa/extras/odfexport/odfexport.cxx | 5 +++++ 3 files changed, 7 insertions(+)
New commits: commit 793442046ac78548514b6833cd5dfd620f0ff318 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Fri May 19 16:21:48 2017 +0200 svtools: fix mime type of PDF images Otherwise the UNO API user can only see this image has a replacement, but not possible to say if it's an SVG or a PDF image. (cherry picked from commit 9b261681e5325e3fb7c87653de8e367ec18486c9) Change-Id: Ibde7915e02620acecbbb237dc3b333382d9c784a Reviewed-on: https://gerrit.libreoffice.org/37837 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index 22e8285cae37..8bba24751935 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -307,6 +307,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** // added Svg mimetype support case GfxLinkType::NativeSvg: pMimeType = MIMETYPE_SVG; break; + case GfxLinkType::NativePdf: pMimeType = MIMETYPE_PDF; break; default: pMimeType = nullptr; diff --git a/svtools/source/graphic/descriptor.hxx b/svtools/source/graphic/descriptor.hxx index 4878ceef5b2d..8c1c352b64fd 100644 --- a/svtools/source/graphic/descriptor.hxx +++ b/svtools/source/graphic/descriptor.hxx @@ -51,6 +51,7 @@ #define MIMETYPE_SGV "image/x-sgv" #define MIMETYPE_EMF "image/x-emf" #define MIMETYPE_SVG "image/svg+xml" +#define MIMETYPE_PDF "application/pdf" #define MIMETYPE_VCLGRAPHIC "image/x-vclgraphic" namespace comphelper { class PropertySetInfo; } diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index a8a8812508b5..13b9a368fb02 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -1210,6 +1210,11 @@ DECLARE_ODFEXPORT_TEST(testEmbeddedPdf, "embedded-pdf.odt") // This failed, pdf+png replacement graphics pair didn't survive an ODT roundtrip. CPPUNIT_ASSERT(!getProperty<OUString>(xShape, "ReplacementGraphicURL").isEmpty()); + auto xGraphic = getProperty< uno::Reference<graphic::XGraphic> >(xShape, "Graphic"); + CPPUNIT_ASSERT(xGraphic.is()); + // This was image/x-vclgraphic, not exposing the info that the image is a PDF one. + CPPUNIT_ASSERT_EQUAL(OUString("application/pdf"), getProperty<OUString>(xGraphic, "MimeType")); + if (mbExported) { uno::Sequence<uno::Any> aArgs(1); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits