From 40f627c28deb9c7eacd77c4a2c4e2eb919d5cf88 Mon Sep 17 00:00:00 2001 From: Serge Krot Date: Mon, 2 Oct 2017 17:40:59 +0200 Subject: tdf#66398 Remove double initialization of the form protection Change-Id: I639523b55aef1914ddec62aaae44b0dc87346d0b Reviewed-on: https://gerrit.libreoffice.org/43157 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- sw/source/filter/ww8/docxexport.cxx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'sw') diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index b76c121bb0d2..8e6b8d5cce21 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -931,12 +931,6 @@ void DocxExport::WriteSettings() pFS->singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val ), OString::number( m_aSettings.defaultTabStop).getStr(), FSEND ); - // Protect form - if( m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::PROTECT_FORM )) - { - pFS->singleElementNS( XML_w, XML_documentProtection, FSNS(XML_w, XML_edit), "forms", FSNS(XML_w, XML_enforcement), "1", FSEND ); - } - // Do not justify lines with manual break if( m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK )) { @@ -1070,14 +1064,18 @@ void DocxExport::WriteSettings() } } + // Protect form // Section-specific write protection - if ( m_pSections->DocumentIsProtected() ) + if (m_pDoc->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_FORM) || + m_pSections->DocumentIsProtected()) { - pFS->singleElementNS( XML_w, XML_documentProtection, - FSNS( XML_w, XML_enforcement ), "true", - FSNS( XML_w, XML_edit ), "forms", - FSEND ); + pFS->singleElementNS(XML_w, XML_documentProtection, + FSNS(XML_w, XML_edit), "forms", + FSNS(XML_w, XML_enforcement), "true", + FSEND); } + + // finish settings.xml pFS->endElementNS( XML_w, XML_settings ); } -- cgit