summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-10-18 09:38:47 +0300
committerJustin Luth <justin_luth@sil.org>2018-10-20 06:32:29 +0200
commitfa667b6dc410f3af57ef436cc117352c829f95e7 (patch)
tree00f041146929bf9baf9191015b5da8246d9403d8
parent6baca63b44bf7f75a522b1adc4b4bbce502aec3b (diff)
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: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx1
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx4
2 files changed, 1 insertions, 4 deletions
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 84f9e2f2d6cf..d5a888e60dd6 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -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"));
}
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index a2d8856733fb..ca1ae82deee6 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -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();