summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-04-20 17:58:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-04-20 21:12:56 +0200
commitb11188835d3b87cd9d2a8cdb3da204cfda5d3e6e (patch)
treed4c652363b1f20e7399be1fd01d74099e3aa8f3c /oox
parent40edbce3988946d0ffceb9554de42e1e469edd92 (diff)
DOC import: lazy-read images
At least JPEG files are now only loaded when the user scrolls to the relevant page. Also fix the root cause of the EMF lazy-read problem and remove the previous workarounds. Change-Id: I9699927282b99bcb71a0d271a20bbfd56a361ee8 Reviewed-on: https://gerrit.libreoffice.org/53219 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/helper/graphichelper.cxx7
1 files changed, 1 insertions, 6 deletions
diff --git a/oox/source/helper/graphichelper.cxx b/oox/source/helper/graphichelper.cxx
index 002d54b946b5..073cfe6d694f 100644
--- a/oox/source/helper/graphichelper.cxx
+++ b/oox/source/helper/graphichelper.cxx
@@ -244,7 +244,7 @@ Reference< XGraphic > GraphicHelper::importGraphic( const Reference< XInputStrea
aArgs[ 1 ].Name = "LazyRead";
aArgs[ 1 ].Value <<= true;
- if ( pExtHeader )
+ if ( pExtHeader && pExtHeader->mapMode > 0 )
{
aArgs.realloc( aArgs.getLength() + 1 );
Sequence< PropertyValue > aFilterData( 3 );
@@ -341,11 +341,6 @@ Reference< XGraphic > GraphicHelper::importEmbeddedGraphic( const OUString& rStr
EmbeddedGraphicMap::const_iterator aIt = maEmbeddedGraphics.find( rStreamName );
if( aIt == maEmbeddedGraphics.end() )
{
- // TODO make lazy-load work for EMF as well.
- WmfExternal aHeader;
- if (rStreamName.endsWith(".emf") && !pExtHeader)
- pExtHeader = &aHeader;
-
xGraphic = importGraphic(mxStorage->openInputStream(rStreamName), pExtHeader);
if( xGraphic.is() )
maEmbeddedGraphics[ rStreamName ] = xGraphic;