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.cicek@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184196
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Bayram Çiçek
2025-04-15 11:05:02 +02:00
committed by Caolán McNamara
parent 0f097aee61
commit 89fdd81f17
2 changed files with 9 additions and 0 deletions
@@ -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");