summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-05-27 21:24:42 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2019-06-13 18:27:50 +0200
commite6f0794be0bfaa55c992758a38444e1bcc481c45 (patch)
tree8dd06f951ae10f19cce7161c0f1f4e3d9e9c95a5 /filter
parentd0b03870b7eb67a5a4f4981c1e104ca03bd6e993 (diff)
tdf#125281 DOC import: fix size of lazy-loaded metafiles
Metafiles may have an external header, so once graphic data is read, we need to set the size explicitly. Otherwise the width of the EMF image in the bugdoc will be too small. (cherry picked from commit 69b62cfcbd364d7f62142149c2f690104b217ca1) Conflicts: filter/source/msfilter/msdffimp.cxx sw/qa/extras/ww8import/ww8import.cxx Change-Id: I2441eda61278b0f4973db5d9aa14618ccd17c397 Reviewed-on: https://gerrit.libreoffice.org/73180 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index c9087180ecdf..b6898f1478fb 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6558,6 +6558,11 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, tool
// size to the size of this record.
sal_uInt64 maxSize = pGrStream == &rBLIPStream ? nLength : 0;
Graphic aGraphic = rGF.ImportUnloadedGraphic(*pGrStream, maxSize);
+
+ // Size available in metafile header, set that here.
+ if (aMtfSize100.getWidth() && aMtfSize100.getHeight())
+ aGraphic.SetPrefSize(aMtfSize100);
+
if (aGraphic)
{
rData = aGraphic;