summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-09-07 08:42:46 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-07 08:45:29 +0200
commitb484e9814c66d8d51cea974390963a6944bc9d73 (patch)
treeccc0ea56520d0ede32a0bd93bb14a3dcfb45004b /sw/qa
parent5963c6c1a0158d9d93dd8a0433ab08d424bf7675 (diff)
tdf#83227 oox: reuse RelId in DML/VML export for the same graphic
So that large images are written only once to the ZIP container when they are exported using both markups. This affects drawinglayer images, the Writer ones are handled directly in sw and were already deduplicated. Change-Id: Iff7c769329b42939833056b727b070f6a60da5e3
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf83227.docxbin0 -> 14647 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf83227.docx b/sw/qa/extras/ooxmlexport/data/tdf83227.docx
new file mode 100644
index 000000000000..bca19a955ecf
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf83227.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index f14190096e50..37c19c2939c3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -800,6 +800,18 @@ DECLARE_OOXMLEXPORT_TEST(testSimpleSdts, "simple-sdts.docx")
}
+DECLARE_OOXMLEXPORT_TEST(testTdf83227, "tdf83227.docx")
+{
+ // Bug document contains a rotated image, which is handled as a draw shape (not as a Writer image) on export.
+ if (!mbExported)
+ return;
+
+ uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL());
+ CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("word/media/image1.png")));
+ // This was also true, image was written twice.
+ CPPUNIT_ASSERT_EQUAL(false, bool(xNameAccess->hasByName("word/media/image2.png")));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */