diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-06-14 15:35:24 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-06-14 16:54:26 +0200 |
commit | 142aa77265361492e74707b08c5bcd366e7205ad (patch) | |
tree | 5ace9ee31ab9c7dac046c3432b89c2b79ffca63b /sw | |
parent | 7b31137fee6b9c81bd88944f9dd08c9ad4620103 (diff) |
tdf#155690 writerfilter: fix import of bookmark in table...
... at start of section.
(regression from commit 2e8aad6d45c53d554ccaf26de998ede708cfc289)
Change-Id: I1e0e720758b607b69645b29c46f4092264289f9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153053
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf155690.docx | bin | 0 -> 17677 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 47 |
2 files changed, 47 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf155690.docx b/sw/qa/extras/ooxmlexport/data/tdf155690.docx Binary files differnew file mode 100644 index 000000000000..1839862688ee --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf155690.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index f6c1b84fcec9..80243ba64a2d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -58,6 +58,53 @@ DECLARE_OOXMLEXPORT_TEST(testTdf126994_lostPageBreak, "tdf126994_lostPageBreak.d CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of Pages", 3, getPages() ); } +DECLARE_OOXMLEXPORT_TEST(testTdf155690, "tdf155690.docx") +{ + uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XNameAccess> xBookmarks = xBookmarksSupplier->getBookmarks(); + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row1_1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + // the problem was that the start was after the H + CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); + } + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row1_2"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); + } + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row1_3"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + CPPUNIT_ASSERT_EQUAL(OUString("ello world"), xMark->getAnchor()->getString()); + } + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row1_4"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); + } + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row2_1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); + } + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row2_1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); + } + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row2_3"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + CPPUNIT_ASSERT_EQUAL(OUString("ello world"), xMark->getAnchor()->getString()); + } + { + uno::Reference<text::XTextContent> xMark(xBookmarks->getByName("row2_4"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xMark.is()); + CPPUNIT_ASSERT_EQUAL(OUString("Hello world"), xMark->getAnchor()->getString()); + } +} + CPPUNIT_TEST_FIXTURE(Test, testTdf121374_sectionHF) { loadAndReload("tdf121374_sectionHF.odt"); |