summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-05-31 09:11:52 +0200
committerCaolán McNamara <caolanm@redhat.com>2016-06-07 08:05:14 +0000
commitad049ffa1d3a22fac4864cae972690a1e46993c9 (patch)
tree6e1cd08acc9ff728edd8ce5787ddc2a32ad14794 /sw
parentf5f5ad7fa79f414682f0e6f61b5612ff74ad38c3 (diff)
tdf#77349 RTF import: automatically generate names for images if needed
The DOC/ODT import can call SwDoc::SetAllUniqueFlyNames() at the end of the process to assign unique names to fly frames which lack a name. Add a similar (but much simpler) feature to the domain mapper to avoid empty image names in the DOCX/RTF import result, so it's easier to click on the items in Writer's navigator. (cherry picked from commit 526ed1f7dbd9150734edcb03727d49e1b1306f56) Change-Id: I432fc741f8d75d735e1dfe88daba50ba0797042d Reviewed-on: https://gerrit.libreoffice.org/25825 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/tdf77349.rtf3
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx7
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf77349.rtf b/sw/qa/extras/rtfimport/data/tdf77349.rtf
new file mode 100644
index 000000000000..1451b367823a
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf77349.rtf
@@ -0,0 +1,3 @@
+{\rtf1
+{\pict \pngblip \picw-64 \pich-1061137057 \picwgoal0 \pichgoal0 47494638396110001000d5ff00000000ffffffc0c0c0555f00ffffaafcfcfcf6f6f6eaeaeae6e6e6e4e4e4e3e3e3c2c2c2c1c1c1bcbcbcb5b5b5b3b3b3b0b0b0adadada5a5a5a2a2a2a1a1a19f9f9f9494948a8a8a8888888686867b7b7b6c6c6c5c5c5c4e4e4e4b4b4b4747474646463d3d3d3c3c3c2e2e2e2525251b1b1b18181810101009090906060603030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000002002c0000000010001000000684408170482c0a06c8a4728924389f506833b281302a8e6b164b18103024c52111504cca67332102e0042e9a40d9319f8300a343c1200f54e47f7e2a00001e0b0a7d0d728a010d838400261a7c0d94947784252700127e9d159f6c8411140019080ea7a9a85f842122281612b1b3b25d6b1f29291d0fbbbdbc5d5e51c34e4cc64a46c94341003b}
+\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 66b4c0410ff4..5fa67e93a2cd 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2588,6 +2588,13 @@ DECLARE_RTFIMPORT_TEST(testTdf74795, "tdf74795.rtf")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(xCell, "LeftBorderDistance"));
}
+DECLARE_RTFIMPORT_TEST(testTdf77349, "tdf77349.rtf")
+{
+ uno::Reference<container::XNamed> xImage(getShape(1), uno::UNO_QUERY);
+ // This was empty: imported image wasn't named automatically.
+ CPPUNIT_ASSERT_EQUAL(OUString("graphic1"), xImage->getName());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */