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

Miklos Vajna vmiklos at collabora.co.uk
Wed Mar 26 07:40:48 PDT 2014


 sw/qa/extras/ww8import/data/cp1000044.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx      |    7 +++++++
 sw/source/filter/ww8/ww8par.cxx           |    4 +++-
 3 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 8757bea2e88c6e349e1fe98d8e9695d7b9c6179e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Mar 26 13:34:08 2014 +0100

    cp#1000044 DOC import: fProtEnabled means document is not totally read-only
    
    Reading the spec, it seems that we have two cases here:
    
    - if lKeyProtDoc is set and fProtEnabled is 1, then editing forms is
      allowed
    - if lKeyProtDoc is set, but fProtEnabled is 0, then the document is
      totally read-only
    
    So in the first case avoid the SetModifyPasswordHash() call to allow
    form field editing.
    
    Change-Id: Id0c48e8eb4bde75c5520a7b108fcfada51148faf

diff --git a/sw/qa/extras/ww8import/data/cp1000044.doc b/sw/qa/extras/ww8import/data/cp1000044.doc
new file mode 100755
index 0000000..ea30cc0
Binary files /dev/null and b/sw/qa/extras/ww8import/data/cp1000044.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 875c039..17296e4 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -243,6 +243,13 @@ DECLARE_WW8IMPORT_TEST(testBnc821208, "bnc821208.doc")
     CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, ePropertyState);
 }
 
+DECLARE_WW8IMPORT_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()));
+}
+
 DECLARE_WW8IMPORT_TEST(testCp1000039, "cp1000039.doc")
 {
     // This was RTL_TEXTENCODING_SYMBOL, causing "1" rendered as a placeholder rectangle.
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 9df2cfb..ed003a2 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1947,7 +1947,9 @@ void SwWW8ImplReader::ImportDop()
         }
     }
 
-    mpDocShell->SetModifyPasswordHash(pWDop->lKeyProtDoc);
+    // Still allow editing of form fields.
+    if (!pWDop->fProtEnabled)
+        mpDocShell->SetModifyPasswordHash(pWDop->lKeyProtDoc);
 
     const SvtFilterOptions& rOpt = SvtFilterOptions::Get();
     if (rOpt.IsUseEnhancedFields())


More information about the Libreoffice-commits mailing list