summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-02-23 09:13:40 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-02-23 09:14:36 +0100
commit6f94cab9c43f88624b58a47ad03ad5f87032595d (patch)
treea2b0e4843d81befabcf929e3b5cd94b1b21a58f4 /sw
parent4f6e3108d9b9b67f21d11d597f2e607acafabd72 (diff)
tdf#59699 RTF import: handle INCLUDEPICTURE field
On one hand, don't handle a fieldmark for it in dmapper. On the other hand, handle the field in the RTF tokenizer as it would be {\pict ...hexdump... }, that will result in an inline picture, as wanted. Change-Id: I554fdf017920350144300fd86617bf74eed8995b
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/libreoffice.pngbin0 -> 767 bytes
-rw-r--r--sw/qa/extras/rtfimport/data/tdf59699.rtf10
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
3 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/libreoffice.png b/sw/qa/extras/rtfimport/data/libreoffice.png
new file mode 100644
index 000000000000..437f613c178c
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/libreoffice.png
Binary files differ
diff --git a/sw/qa/extras/rtfimport/data/tdf59699.rtf b/sw/qa/extras/rtfimport/data/tdf59699.rtf
new file mode 100644
index 000000000000..94331cc62113
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf59699.rtf
@@ -0,0 +1,10 @@
+{\rtf1
+\pard\plain
+{\field
+{\*\fldinst
+{ INCLUDEPICTURE "libreoffice.png" \\* MERGEFORMAT \\d }
+}
+{\fldrslt}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 52b9fd066999..b1a62929d20e 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -48,6 +48,7 @@
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/graphic/XGraphic.hpp>
#include <rtl/ustring.hxx>
#include <vcl/outdev.hxx>
@@ -633,6 +634,14 @@ DECLARE_RTFIMPORT_TEST(testFdo49659, "fdo49659.rtf")
CPPUNIT_ASSERT_EQUAL(graphic::GraphicType::PIXEL, getProperty<sal_Int8>(xGraphic, "GraphicType"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf59699, "tdf59699.rtf")
+{
+ // This resulted in a lang.IndexOutOfBoundsException: the referenced graphic data wasn't imported.
+ uno::Reference<beans::XPropertySet> xImage(getShape(1), uno::UNO_QUERY);
+ auto xGraphic = getProperty<uno::Reference<graphic::XGraphic> >(xImage, "Graphic");
+ CPPUNIT_ASSERT(xGraphic.is());
+}
+
DECLARE_RTFIMPORT_TEST(testFdo46966, "fdo46966.rtf")
{
/*