diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-06-25 22:13:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-06-26 09:04:58 +0200 |
commit | fa356008b08a8a5b5556aa8f89ca8f7989c53516 (patch) | |
tree | a4bfb9bffd3e6a60e50e66464d440dcdebaf35da /oox | |
parent | 0901f0b88beb50d9d6acc6eccd96fe55d96a6986 (diff) |
tdf#118133 DOCX import: disable lazy-loading of tiff images
The same code that works for jpeg/png doesn't work for tiff, go back to
synchronous loading there for now.
Change-Id: I9b16f40811f6d485c986bd06daa7d4d8c8a76178
Reviewed-on: https://gerrit.libreoffice.org/56415
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/graphichelper.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx index 073cfe6d694f..6500f82e9a44 100644 --- a/oox/source/helper/graphichelper.cxx +++ b/oox/source/helper/graphichelper.cxx @@ -242,7 +242,8 @@ Reference< XGraphic > GraphicHelper::importGraphic( const Reference< XInputStrea aArgs[ 0 ].Name = "InputStream"; aArgs[ 0 ].Value <<= rxInStrm; aArgs[ 1 ].Name = "LazyRead"; - aArgs[ 1 ].Value <<= true; + bool bLazyRead = !pExtHeader; + aArgs[ 1 ].Value <<= bLazyRead; if ( pExtHeader && pExtHeader->mapMode > 0 ) { @@ -341,6 +342,11 @@ Reference< XGraphic > GraphicHelper::importEmbeddedGraphic( const OUString& rStr EmbeddedGraphicMap::const_iterator aIt = maEmbeddedGraphics.find( rStreamName ); if( aIt == maEmbeddedGraphics.end() ) { + // Lazy-loading doesn't work with TIFF at the moment. + WmfExternal aHeader; + if (rStreamName.endsWith(".tiff") && !pExtHeader) + pExtHeader = &aHeader; + xGraphic = importGraphic(mxStorage->openInputStream(rStreamName), pExtHeader); if( xGraphic.is() ) maEmbeddedGraphics[ rStreamName ] = xGraphic; |