summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-26 13:34:08 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-26 15:40:22 +0100
commit8757bea2e88c6e349e1fe98d8e9695d7b9c6179e (patch)
tree143ac8603e3073b176423cd3006a9523cf6392e7
parent586245eb1fb5a5a65f907056285be68ce56d1a50 (diff)
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
-rwxr-xr-xsw/qa/extras/ww8import/data/cp1000044.docbin0 -> 26112 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx7
-rw-r--r--sw/source/filter/ww8/ww8par.cxx4
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8import/data/cp1000044.doc b/sw/qa/extras/ww8import/data/cp1000044.doc
new file mode 100755
index 000000000000..ea30cc0024ce
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/cp1000044.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 875c039bb15f..17296e4ca5ec 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 9df2cfbc89d5..ed003a22ef19 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())