Kaydet (Commit) 9b261681 authored tarafından Miklos Vajna's avatar Miklos Vajna

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.

Change-Id: Ibde7915e02620acecbbb237dc3b333382d9c784a
Reviewed-on: https://gerrit.libreoffice.org/37827Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst b6778e92
......@@ -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;
......
......@@ -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; }
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment