diff options
author | Eilidh McAdam <eilidh.mcadam@itomig.de> | 2015-03-18 02:00:28 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-04-01 12:29:50 +0000 |
commit | bb96ad0f9a24f92c8553da566f0ebedc064a1318 (patch) | |
tree | 8756b667fa603597a65fa0dc65b8de48b1f55c2c /sw | |
parent | bd23cf009a7e3c63a066794d41ae0c97589c8891 (diff) |
tdf#60060: DOCX export of section protection
Initial implementation - no password protection is saved.
Specific sections are protected in OOXML by using form protection;
that is, only form elements may be edited in protected sections.
Change-Id: I294064bbc4e3c307d17001ebd21f1bd6f07de42c
Reviewed-on: https://gerrit.libreoffice.org/14895
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c0dbda73431f..45b7bbfe1220 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5401,7 +5401,8 @@ void DocxAttributeOutput::EndSection() void DocxAttributeOutput::SectionFormProtection( bool bProtected ) { if ( bProtected ) - m_pSerializer->singleElementNS( XML_w, XML_formProt, FSEND ); + m_pSerializer->singleElementNS( XML_w, XML_formProt, + FSNS( XML_w, XML_val ), "true", FSEND ); else m_pSerializer->singleElementNS( XML_w, XML_formProt, FSNS( XML_w, XML_val ), "false", FSEND ); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 96c8c7ca3ca3..30ea86731545 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -930,6 +930,15 @@ void DocxExport::WriteSettings() } } + // Section-specific write protection + if ( m_pSections->DocumentIsProtected() ) + { + pFS->singleElementNS( XML_w, XML_documentProtection, + FSNS( XML_w, XML_enforcement ), "true", + FSNS( XML_w, XML_edit ), "forms", + FSEND ); + } + pFS->endElementNS( XML_w, XML_settings ); } |