diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-06-11 08:09:14 +0200 |
---|---|---|
committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | 2019-06-13 23:35:27 +0200 |
commit | a21e297b1229dd389c691893ddc48605e9471db0 (patch) | |
tree | 497424901d38eee8bc0b3da6f04040fde342041f /filter | |
parent | 7ae354290af7f3fcd9c5031e437af0037e61e984 (diff) |
tdf#125591 DOC import: lazy-load metafiles with explicit size
Regression from commit 69b62cfcbd364d7f62142149c2f690104b217ca1
(tdf#125281 DOC import: fix size of lazy-loaded metafiles, 2019-05-27),
the problem is that setting the preferred size of a Graphic swaps it in.
Avoid this by extending ImportUnloadedGraphic(): if a size hint is
provided, then that will be used instead of info from the graphic
descriptor (which is usually only meaningful for bitmaps).
This way we maintain the correct size and we're back to lazy-loading
metafiles from binary MSO files as well.
(cherry picked from commit acb803b730f2c6bd82e39beab58949ec14f85eb0)
and:
CppunitTest_sw_ww8import: disable failing assert on Windows
It fails only sometimes, it's yet clear why.
(cherry picked from commit b5d624c4af1085d4670149e9c1d280da7bc9add0)
Change-Id: Ide12d12166110e98ea47b5347dd24fb203b22da3
Reviewed-on: https://gerrit.libreoffice.org/73961
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index b6898f1478fb..5eb3249628bc 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -6557,11 +6557,13 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, tool // which may be very large if the whole document is large. Limit the read // size to the size of this record. sal_uInt64 maxSize = pGrStream == &rBLIPStream ? nLength : 0; - Graphic aGraphic = rGF.ImportUnloadedGraphic(*pGrStream, maxSize); + Graphic aGraphic; - // Size available in metafile header, set that here. + // Size available in metafile header. if (aMtfSize100.getWidth() && aMtfSize100.getHeight()) - aGraphic.SetPrefSize(aMtfSize100); + aGraphic = rGF.ImportUnloadedGraphic(*pGrStream, maxSize, &aMtfSize100); + else + aGraphic = rGF.ImportUnloadedGraphic(*pGrStream, maxSize); if (aGraphic) { |