sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+)
New commits: commit 8b7910e0ba63aebb6fd6befa937259420f7266f3 Author: Serge Krot <serge.k...@cib.de> Date: Tue Oct 10 15:57:14 2017 +0200 tdf#66398 Enhance unit test: check permissions at content level Change-Id: I3bec3fe12e97e0063f597cd117cd5d8a7d5465a9 Reviewed-on: https://gerrit.libreoffice.org/43311 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 418b0dc64019..d4ef02c10cb5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -947,6 +947,7 @@ DECLARE_OOXMLEXPORT_TEST(testSectionProtection, "sectionprot.odt") DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx") { + // check document permission settings for the whole document if (xmlDocPtr pXmlSettings = parseExport("word/settings.xml")) { assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "edit", "readOnly"); @@ -959,6 +960,16 @@ DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, "tdf66398_permissions.docx") assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "hash", "A0/Xy6KcXljJlZjP0TwJMPJuW2rc46UwXqn2ctxckc2nCECE5i89M85z2Noh3ZEA5NBQ9RJ5ycxiUH6nzmJaKw=="); assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "salt", "B8k6wb1pkjUs4Nv/8QBk/w=="); } + + // 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(xBookmarksByIdx->getCount(), static_cast<sal_Int32>(2)); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("_GoBack")); + CPPUNIT_ASSERT(xBookmarksByName->hasByName("permission-for-group:267014232:everyone")); } DECLARE_OOXMLEXPORT_TEST(testSectionHeader, "sectionprot.odt") _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits