sw/qa/extras/ooxmlexport/data/tdf166173_enforcement.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport20.cxx               |    9 +++++++++
 2 files changed, 9 insertions(+)

New commits:
commit bbc219ce71f81020f8a6b0fb0109ccd853ff97f5
Author:     Bayram Çiçek <bayram.ci...@collabora.com>
AuthorDate: Tue Apr 15 10:17:01 2025 +0300
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Apr 15 12:41:32 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/+/184210
    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 8812cf729ee0..28adfd5c2a53 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx
@@ -650,6 +650,15 @@ DECLARE_OOXMLEXPORT_TEST(tdf66398_permissions, 
"tdf66398_permissions.docx")
     
CPPUNIT_ASSERT(xBookmarksByName->hasByName("permission-for-group:267014232:everyone"));
 }
 
+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"_ostr, 
"enforcement"_ostr, "0");
+}
+
 CPPUNIT_TEST_FIXTURE(Test, tdf106843)
 {
     loadAndSave("tdf106843.fodt");

Reply via email to