summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-16 09:16:43 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-16 09:16:43 +0100
commit6083a8f188e2cd3fe6849e2112a6b06fbf8e1ad3 (patch)
treefe15c1470e806b7eb4ef132221c47474b19dd35c /sw/qa/extras/ooxmlimport
parentec935c9b83ff2872c039522398c49e070149eea1 (diff)
Related: tdf#59699 DOCX import: fix linked graphics with relative URLs
Because the writerfilter::ooxml::OOXMLFastContextHandlerShape constructor only sent the input stream (and not the full media descriptor) to oox::shape::ShapeContextHandler, it's startFastElement() tried to reconstruct a media descriptor from just the input stream. As a result, the base URL of the document got lost at the time the oox::drawingml::BlipContext constructor tried to call getAbsoluteUrl(), to convert the relative URL to an absolute one. Fix the problem by sending not only the input stream, but the full media descriptor to the shape importer. As a bonus that makes code simpler, too. Change-Id: I1f06c04d0745aa7e2e06d4848cf454790d5073ca
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r--sw/qa/extras/ooxmlimport/data/libreoffice.pngbin0 -> 767 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf59699.docxbin0 -> 13232 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
3 files changed, 8 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/libreoffice.png b/sw/qa/extras/ooxmlimport/data/libreoffice.png
new file mode 100644
index 000000000000..437f613c178c
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/libreoffice.png
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/data/tdf59699.docx b/sw/qa/extras/ooxmlimport/data/tdf59699.docx
new file mode 100644
index 000000000000..158ac338f88a
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf59699.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 57507ea2c98e..5ede1d50f416 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -782,6 +782,14 @@ DECLARE_OOXMLIMPORT_TEST(testN777345, "n777345.docx")
#endif
}
+DECLARE_OOXMLIMPORT_TEST(testTdf59699, "tdf59699.docx")
+{
+ uno::Reference<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY);
+ auto xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic");
+ // This was false: the referenced graphic data wasn't imported.
+ CPPUNIT_ASSERT(xGraphic.is());
+}
+
DECLARE_OOXMLIMPORT_TEST(testN777337, "n777337.docx")
{
/*