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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Oct 11 05:17:04 UTC 2018


 sw/qa/extras/ww8export/ww8export.cxx |    6 ++++++
 sw/source/filter/ww8/wrtww8.cxx      |    1 +
 2 files changed, 7 insertions(+)

New commits:
commit 9943f37e8a80f2c4df6d58da4c50f3e7f3d6f3ce
Author:     Justin Luth <justin.luth at collabora.com>
AuthorDate: Wed Oct 10 23:38:22 2018 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Thu Oct 11 07:16:39 2018 +0200

    related tdf#120225 ww8export: save PROTECT_FORM
    
    Change-Id: I20664f8c2dc2c49feec17ee6a1df72776d43cc40
    Reviewed-on: https://gerrit.libreoffice.org/61635
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_luth at sil.org>

diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index a53525a5ece7..33951f4f0666 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -11,6 +11,7 @@
 
 //#include <com/sun/star/text/XDependentTextField.hpp>
 
+#include <IDocumentSettingAccess.hxx>
 #include <com/sun/star/awt/FontWeight.hpp>
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/awt/XBitmap.hpp>
@@ -358,6 +359,11 @@ DECLARE_WW8EXPORT_TEST(testCp1000044, "cp1000044.doc")
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
     // It wasn't possible to fill out this form.
     CPPUNIT_ASSERT_EQUAL(false, bool(xStorable->isReadonly()));
+
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
+    CPPUNIT_ASSERT(pTextDoc);
+    SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+    CPPUNIT_ASSERT_EQUAL( true, pDoc->getIDocumentSettingAccess().get( DocumentSettingId::PROTECT_FORM ) );
 }
 
 DECLARE_WW8EXPORT_TEST(testBorderColours, "bordercolours.doc")
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index b14a76d0c957..c6dda312b4b1 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -511,6 +511,7 @@ static void WriteDop( WW8Export& rWrt )
     }
 
     if ((rWrt.pSepx && rWrt.pSepx->DocumentIsProtected()) ||
+        rWrt.m_pDoc->getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_FORM ) ||
         rDop.lKeyProtDoc != 0)
     {
         rDop.fProtEnabled =  true;


More information about the Libreoffice-commits mailing list