summaryrefslogtreecommitdiff
path: root/vcl
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 /vcl
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 'vcl')
-rw-r--r--vcl/source/filter/graphicfilter.cxx1
-rw-r--r--vcl/source/graphic/UnoGraphicProvider.cxx6
2 files changed, 4 insertions, 3 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 023c07ecb9a2..43feef35e5e2 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1572,6 +1572,7 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream)
nGraphicContentSize = nStreamLength;
pGraphicContent.reset(new sal_uInt8[nGraphicContentSize]);
+ rIStream.Seek(nStreamBegin);
rIStream.ReadBytes(pGraphicContent.get(), nStreamLength);
if (!rIStream.GetError())
diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx
index 8b9ccb93bf94..7adb183f5aa8 100644
--- a/vcl/source/graphic/UnoGraphicProvider.cxx
+++ b/vcl/source/graphic/UnoGraphicProvider.cxx
@@ -355,9 +355,6 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
}
}
- if (bLazyRead && aFilterData.hasElements())
- bLazyRead = false;
-
SolarMutexGuard g;
if( xIStm.is() )
@@ -396,7 +393,10 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
aExtHeader.mapMode = nExtMapMode;
WmfExternal *pExtHeader = nullptr;
if ( nExtMapMode > 0 )
+ {
pExtHeader = &aExtHeader;
+ bLazyRead = false;
+ }
ErrCode error = ERRCODE_NONE;
if (bLazyRead)