summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/xml/xmlgrhlp.cxx2
-rw-r--r--sw/source/core/graphic/ndgrf.cxx3
-rw-r--r--vcl/source/gdi/impgraph.cxx4
3 files changed, 9 insertions, 0 deletions
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 6422c161319e..66f2a1866c41 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -473,6 +473,7 @@ OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( const OUString& rFileName )
{ "jpg", "image/jpeg" },
{ "tif", "image/tiff" },
{ "svg", "image/svg+xml" },
+ { "pdf", "application/pdf" },
{ "wmf", "image/x-wmf" },
{ "eps", "image/x-eps" },
{ "bmp", "image/bmp" },
@@ -691,6 +692,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const OUString& rURLStr, sal_uInt
else
aExtension = ".svg";
break;
+ case GfxLinkType::NativePdf: aExtension = ".pdf"; break;
default:
aExtension = ".grf";
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 7b513136c254..97e1b6c49dc6 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -402,6 +402,9 @@ const GraphicObject* SwGrfNode::GetReplacementGrfObj() const
{
const_cast< SwGrfNode* >(this)->mpReplacementGraphic = new GraphicObject(rSvgDataPtr->getReplacement());
}
+ else if (GetGrfObj().GetGraphic().getPdfData().hasElements())
+ // This returns the metafile, without the pdf data.
+ const_cast<SwGrfNode*>(this)->mpReplacementGraphic = new GraphicObject(GetGrfObj().GetGraphic().GetGDIMetaFile());
}
return mpReplacementGraphic;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 933a0a60ffe9..25d82d8fc8ac 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1406,6 +1406,10 @@ BitmapChecksum ImpGraphic::ImplGetChecksum() const
default:
nRet = maMetaFile.GetChecksum();
+ if (maPdfData.hasElements())
+ // Include the PDF data in the checksum, so a metafile with
+ // and without PDF data is considered to be different.
+ nRet = vcl_get_checksum(nRet, maPdfData.getConstArray(), maPdfData.getLength());
break;
}
}