[Libreoffice-commits] core.git: sw/source

Serge Krot Serge.Krot at cib.de
Fri Oct 6 17:13:52 UTC 2017


 sw/source/filter/ww8/docxexport.cxx |   20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 40f627c28deb9c7eacd77c4a2c4e2eb919d5cf88
Author: Serge Krot <Serge.Krot at cib.de>
Date:   Mon Oct 2 17:40:59 2017 +0200

    tdf#66398 Remove double initialization of the form protection
    
    Change-Id: I639523b55aef1914ddec62aaae44b0dc87346d0b
    Reviewed-on: https://gerrit.libreoffice.org/43157
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

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 );
 }
 


More information about the Libreoffice-commits mailing list