sw/qa/extras/ww8import/data/cp1000044.doc |binary sw/qa/extras/ww8import/ww8import.cxx | 9 +++++++++ sw/source/filter/ww8/ww8par.cxx | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-)
New commits: commit ccfd10ac45265f061737514d60fcf20659d429a4 Author: Miklos Vajna <vmik...@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. (cherry picked from commit 8757bea2e88c6e349e1fe98d8e9695d7b9c6179e) Conflicts: sw/qa/extras/ww8import/ww8import.cxx 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 ef1621e..c34e354 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -37,6 +37,7 @@ public: void testN823651(); void testFdo36868(); void testListNolevel(); + void testCp1000044(); void testCp1000039(); void testBnc821208(); @@ -67,6 +68,7 @@ void Test::run() {"n823651.doc", &Test::testN823651}, {"fdo36868.doc", &Test::testFdo36868}, {"list-nolevel.doc", &Test::testListNolevel}, + {"cp1000044.doc", &Test::testCp1000044}, {"cp1000039.doc", &Test::testCp1000039}, {"bnc821208.doc", &Test::testBnc821208}, }; @@ -288,6 +290,13 @@ void Test::testListNolevel() CPPUNIT_ASSERT_EQUAL(OUString("1."), aText); } +void Test::testCp1000044() +{ + 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())); +} + void Test::testCp1000039() { // 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 ad39b11..5c46957 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1608,7 +1608,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()) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits