summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8import
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 /sw/qa/extras/ww8import
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 'sw/qa/extras/ww8import')
-rw-r--r--sw/qa/extras/ww8import/data/image-lazy-read.docbin0 -> 26624 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx8
2 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/image-lazy-read.doc b/sw/qa/extras/ww8import/data/image-lazy-read.doc
new file mode 100644
index 000000000000..95017d2ac80e
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/image-lazy-read.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 907fe47ebcff..de16cfe253e6 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -116,6 +116,14 @@ DECLARE_WW8IMPORT_TEST( testTdf105570, "tdf105570.doc" )
CPPUNIT_ASSERT_EQUAL( sal_uInt16(0), pTableNd->GetTable().GetRowsToRepeat() );
}
+DECLARE_OOXMLIMPORT_TEST(testImageLazyRead, "image-lazy-read.doc")
+{
+ auto xGraphic = getProperty<uno::Reference<graphic::XGraphic>>(getShape(1), "Graphic");
+ Graphic aGraphic(xGraphic);
+ // This failed, import loaded the graphic, it wasn't lazy-read.
+ CPPUNIT_ASSERT(!aGraphic.isAvailable());
+}
+
DECLARE_WW8IMPORT_TEST(testTdf106799, "tdf106799.doc")
{
sal_Int32 const nCellWidths[3][4] = { { 9530, 0, 0, 0 },{ 2382, 2382, 2382, 2384 },{ 2382, 2382, 2382, 2384 } };