summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-05-06 10:45:10 +0300
committerJustin Luth <justin_luth@sil.org>2020-05-07 06:19:06 +0200
commit0f7f3ede6699df09be5b0d9d24818cf1fbbaf6f6 (patch)
treed906dc904f0ee36d6c54b4f03b16ad5c187440f1 /sw/source
parent7e257697f0006d8247a23ac917bdffb1cda5705d (diff)
tdf#132637 doc import: don't open readonly for lockRev
Just like with forms, the password should not be required to make changes when only enforcement of track changes is specified. So just grabbag the password and let the document open in read-write mode. TODO for the overly zealous: actually enforce file->properties->security->protect track changes, and also export it. (This has been done for DOCX.) Change-Id: Ib68ec5785aa0f5dbac507a3d50059a443f7ff42b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93551 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index cad890294a36..514a5ec9e3d1 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1936,8 +1936,11 @@ void SwWW8ImplReader::ImportDop()
}
}
- // Still allow editing of form fields.
- if (!m_xWDop->fProtEnabled)
+ // The password can force read-only, comments-only, fill-in-form-only, or require track-changes.
+ // Treat comments-only like read-only since Writer has no support for that.
+ // Still allow editing of form fields, without requiring the password.
+ // Still allow editing if track-changes is locked on. (Currently LockRev is ignored/lost on export anyway.)
+ if (!m_xWDop->fProtEnabled && !m_xWDop->fLockRev)
m_pDocShell->SetModifyPasswordHash(m_xWDop->lKeyProtDoc);
else if ( xDocProps.is() )
{