Kaydet (Commit) fa667b6d authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Justin Luth

sw mso export: PROTECT_FORM shouldn't force section to protected

PROTECT_FORM maps to enforcement = true, not "everything is protected".
"The enforcement of this property is determined by the documentProtection
element (§17.15.1.29), as it is possible to specify protection
without turning it on."

So, sections should retain their protected on/off status
regardless of the value of PROTECT_FORM. My guess was
that this was to offset the fact that DOCX import did not
import protected status, so this helped to protect the
sections that should not be unprotected. A followup
patch will address the import side.

patch initially developed to support tdf#120499.

Change-Id: I8ff6d31711651a4827cbb8520fd68e88273d6799
Reviewed-on: https://gerrit.libreoffice.org/61905
Tested-by: Jenkins
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
üst 6baca63b
......@@ -63,7 +63,6 @@ DECLARE_WW8EXPORT_TEST(testFdo53985, "fdo53985.doc")
uno::Reference<beans::XPropertySet> xSect(xSections->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Section1 is protected", true, getProperty<bool>(xSect, "IsProtected"));
xSect.set(xSections->getByIndex(3), uno::UNO_QUERY);
if ( !mbExported )
CPPUNIT_ASSERT_EQUAL_MESSAGE("Section4 is protected", false, getProperty<bool>(xSect, "IsProtected"));
}
......
......@@ -1533,9 +1533,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
AttrOutput().SectFootnoteEndnotePr();
// forms
bool formProtection = m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::PROTECT_FORM );
formProtection |= rSepInfo.IsProtected();
AttrOutput().SectionFormProtection( formProtection );
AttrOutput().SectionFormProtection( rSepInfo.IsProtected() );
// line numbers
const SwLineNumberInfo& rLnNumInfo = m_pDoc->GetLineNumberInfo();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment