summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2017-10-10 15:57:14 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-10-13 10:27:33 +0200
commit8b7910e0ba63aebb6fd6befa937259420f7266f3 (patch)
tree86f913825a97f65a06cd4be871bc2d38e918c8b5
parent0ceb9cb40f2a05e06597ca13dbb01e0a2f663a86 (diff)
tdf#66398 Enhance unit test: check permissions at content level
Change-Id: I3bec3fe12e97e0063f597cd117cd5d8a7d5465a9 Reviewed-on: https://gerrit.libreoffice.org/43311 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx11
1 files changed, 11 insertions, 0 deletions
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")