diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-27 11:26:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-27 10:39:00 +0000 |
commit | fda68426374ed915783fd306c2f56463c757774a (patch) | |
tree | b8e61da4bb9d7ebe770ab7b61e9c3aa09fa3dfb6 /sw/source/core/graphic | |
parent | f474952b9e0e85ea71d26c18351d27b00711ff84 (diff) |
ODT export: add embedded pdf support
Once a .pdf file is inserted in Writer using Insert -> Image, Writer now
advertises a replacement metafile for it (to make LO <= 5.2 and other
ODF readers still be able to read the graphic, where the replacement is
the same as the original metafile, but without .pdf data), and the ODF
export writes the .pdf data with the correct extension / mime type.
Also extend the checksum logic to take care of the pdf data, so on
export xmloff won't think that the full and the replacement graphic are
the same.
The import side is still missing, so no testcase yet.
Change-Id: I5c5b7c80ca4024ecbcb5b2d4442d21ca33755546
Reviewed-on: https://gerrit.libreoffice.org/26695
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/source/core/graphic')
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
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; |