summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfexport
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2018-08-28 14:32:14 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-08-30 00:21:23 +0200
commit3559daee24ea1224d3d40e6a86b10cf37e18443f (patch)
treef4ecb418071b7c4c464335003e947f3bdc598a2d /sw/qa/extras/odfexport
parenta1dd8098e6e2a7d5ba4b9c1a2d094db11d3d6b27 (diff)
tdf#101856 Handle properties of nested bookmarks
Change-Id: I1a92d2001e58751c5bbe41f6480f4c46dcc8c9e7 Reviewed-on: https://gerrit.libreoffice.org/59766 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/qa/extras/odfexport')
-rw-r--r--sw/qa/extras/odfexport/data/tdf101856_overlapped.odtbin0 -> 9233 bytes
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx24
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/tdf101856_overlapped.odt b/sw/qa/extras/odfexport/data/tdf101856_overlapped.odt
new file mode 100644
index 000000000000..c05df538da52
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/tdf101856_overlapped.odt
Binary files differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index ef48e648661b..ab993fb28439 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -1997,6 +1997,30 @@ DECLARE_ODFEXPORT_TEST(testSpellOutNumberingTypes, "spellout-numberingtypes.odt"
}
// MAILMERGE Add conditional to expand / collapse bookmarks
+DECLARE_ODFEXPORT_TEST(tdf101856_overlapped, "tdf101856_overlapped.odt")
+{
+ // get bookmark interface
+ uno::Reference<text::XBookmarksSupplier> xBookmarksSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xBookmarksByIdx(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xBookmarksByName(xBookmarksSupplier->getBookmarks(), uno::UNO_QUERY);
+
+ // check: we have 2 bookmarks
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xBookmarksByIdx->getCount());
+ CPPUNIT_ASSERT(xBookmarksByName->hasByName("BookmarkNonHidden"));
+ CPPUNIT_ASSERT(xBookmarksByName->hasByName("BookmarkHidden"));
+
+ // <text:bookmark-start text:name="BookmarkNonHidden"/>
+ uno::Reference<beans::XPropertySet> xBookmark1(xBookmarksByName->getByName("BookmarkNonHidden"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xBookmark1, UNO_NAME_BOOKMARK_CONDITION));
+ CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(xBookmark1, UNO_NAME_BOOKMARK_HIDDEN));
+
+ // <text:bookmark-start text:name="BookmarkHidden"/>
+ uno::Reference<beans::XPropertySet> xBookmark2(xBookmarksByName->getByName("BookmarkHidden"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString(""), getProperty<OUString>(xBookmark2, UNO_NAME_BOOKMARK_CONDITION));
+ CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xBookmark2, UNO_NAME_BOOKMARK_HIDDEN));
+}
+
+// MAILMERGE Add conditional to expand / collapse bookmarks
DECLARE_ODFEXPORT_TEST(tdf101856, "tdf101856.odt")
{
// get bookmark interface