summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-05-27 21:24:42 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-05-28 09:10:15 +0200
commit69b62cfcbd364d7f62142149c2f690104b217ca1 (patch)
tree2584b8fc78810624981ad10e2c834793258bb23f /filter
parentd0d9acc7c6095e0bc640e073b9d8e2e19aaa8993 (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. Change-Id: I2441eda61278b0f4973db5d9aa14618ccd17c397 Reviewed-on: https://gerrit.libreoffice.org/73064 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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 8dbddea29cf1..1c31a10f7ec8 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -6610,6 +6610,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.IsNone())
{
rData = aGraphic;