sw: always export enforcement attribute of documentProtection

otherwise: (in word/settings.xml)
- if a docx document has w:enforcement="0", LO will not
import it. Hence, LO will not export it, too.
- this will cause a lack of enforcement attr. - which
will make the docx "protected" after export from LO - in MSO Word.

Therefore, we have to import enforcement attr. even if it's
value is "0".

Change-Id: I30cf3cd8725151ea5bd9d4e484757e36602707e5
Signed-off-by: Bayram Çiçek <bayram.cicek@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184042
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Bayram Çiçek
2025-04-11 16:24:07 +02:00
committed by Caolán McNamara
parent a3415dcf31
commit 29c7e73d13
@@ -154,11 +154,13 @@ uno::Sequence<beans::PropertyValue> DocumentProtection::toSequence() const
}
// w:enforcement
if (m_bEnforcement)
{
beans::PropertyValue aValue;
aValue.Name = "enforcement";
aValue.Value <<= u"1"_ustr;
if (m_bEnforcement)
aValue.Value <<= u"1"_ustr;
else
aValue.Value <<= u"0"_ustr;
documentProtection.push_back(aValue);
}