sw/qa/extras/ooxmlexport/data/tdf166173_enforcement.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport20.cxx | 9 +++++++++ 2 files changed, 9 insertions(+)
New commits: commit 92a898142f96c130200b664b24f30e648bd2881f Author: Bayram Çiçek <bayram.ci...@collabora.com> AuthorDate: Tue Apr 15 10:17:01 2025 +0300 Commit: Bayram Çiçek <bayram.ci...@collabora.com> CommitDate: Tue Apr 15 12:15:02 2025 +0200 tdf#166173: add a unittest for enforcement attribute of documentProtection element. - tdf166173_enforcement.docx contains: <w:documentProtection w:edit="forms" w:formatting="1" w:enforcement="0"/> - after export, enforcement attribute should still has '0' value. Change-Id: I38b48eca054a40586539b1de336ba51f46714a34 Signed-off-by: Bayram Çiçek <bayram.ci...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184196 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 89fdd81f17ac24b007bda26ce5176a5b2f65b1d7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184208 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sw/qa/extras/ooxmlexport/data/tdf166173_enforcement.docx b/sw/qa/extras/ooxmlexport/data/tdf166173_enforcement.docx new file mode 100644 index 000000000000..8a3a13e19cbd Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf166173_enforcement.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx index c1ea555a6bdb..de8b3ceedbc3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx @@ -707,6 +707,15 @@ CPPUNIT_TEST_FIXTURE(Test, tdf66398_permissions) u"B8k6wb1pkjUs4Nv/8QBk/w=="); } +CPPUNIT_TEST_FIXTURE(Test, tdf166173_enforcement) +{ + loadAndSave("tdf166173_enforcement.docx"); + xmlDocUniquePtr pXmlSettings = parseExport(u"word/settings.xml"_ustr); + + // check if attribute 'enforcement' of 'documentProtection' has still '0' value. + assertXPath(pXmlSettings, "/w:settings/w:documentProtection", "enforcement", u"0"); +} + CPPUNIT_TEST_FIXTURE(Test, tdf106843) { loadAndSave("tdf106843.fodt");