Kaydet (Commit) 8757bea2 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 586245eb
This diff was suppressed by a .gitattributes entry.
......@@ -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.
......
......@@ -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())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment