diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-08 09:16:22 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-12-13 16:01:02 +0100 |
commit | 41ccad849c222db894e71668020de88844181ec5 (patch) | |
tree | af9b60e1aecb7096d7b548d10cf87b09e36af592 /sw | |
parent | 3eae626e5a3402fe1b218848185324dcd527ff34 (diff) |
fdo#86750 RTF import: fix table of contents links
(cherry picked from commit 4517c94000153eab6c034ea548698953dd93f794)
Change-Id: I0f3d35a0e64c9ce5646fa63eda317bee42de5540
Reviewed-on: https://gerrit.libreoffice.org/13372
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/fdo86750.rtf | 4 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo86750.rtf b/sw/qa/extras/rtfimport/data/fdo86750.rtf new file mode 100644 index 000000000000..29f0b84ca995 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo86750.rtf @@ -0,0 +1,4 @@ +{\rtf1 +{\field{\*\fldinst { HYPERLINK \\l "anchor" }}{\fldrslt click}}\par +{\*\bkmkstart anchor}target{\*\bkmkend anchor}\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index e3fddac5dd99..416b01aab136 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2054,6 +2054,12 @@ DECLARE_RTFIMPORT_TEST(testFdo72031, "fdo72031.rtf") CPPUNIT_ASSERT_EQUAL(aExpected, getRun(getParagraph(1), 1)->getString()); } +DECLARE_RTFIMPORT_TEST(testFdo86750, "fdo86750.rtf") +{ + // This was 'HYPERLINK#anchor', the URL of the hyperlink had the field type as a prefix, leading to broken links. + CPPUNIT_ASSERT_EQUAL(OUString("#anchor"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |