summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-10-18 09:38:47 +0300
committerAndras Timar <andras.timar@collabora.com>2018-10-20 23:00:44 +0200
commit0507a1578da0de9cebda999ec4d916d3bc8b290c (patch)
treeaefcbe1b4d67af2b472281d4b58ca7badade90bd
parent587527b4738e1f99e49959a6ea0de407802e9cb4 (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> (cherry picked from commit fa667b6dc410f3af57ef436cc117352c829f95e7)
-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 30a8b68d6145..c1eb9f8cdf4c 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1530,9 +1530,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();