Resolves: tdf#101245 doc(x) protected areas not protected with disabled cursor

Protected areas of imported doc(x) documents are now protected even when
the “enable cursor” option is disabled: It is still possible to set the
cursor into the protected area, but the text is not editable anymore.

Change-Id: If45dfc82fb7cc70e0a6569a9d735eafcafda9bc2
Reviewed-on: https://gerrit.libreoffice.org/28075
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
This commit is contained in:
Martin Nathansen
2016-08-17 18:00:25 +00:00
committed by Oliver Specht
parent 2a871f0f24
commit e879ddeda3
+4 -1
View File
@@ -67,6 +67,7 @@
#include <sfx2/lokhelper.hxx>
#include <comphelper/string.hxx>
#include <PostItMgr.hxx>
#include <DocumentSettingManager.hxx>
using namespace com::sun::star;
using namespace util;
@@ -3044,7 +3045,9 @@ bool SwCursorShell::HasReadonlySel(bool bAnnotationMode) const
{
bool bRet = false;
// If protected area is to be ignored, then selections are never read-only.
if ((IsReadOnlyAvailable() || GetViewOptions()->IsFormView()) && !GetViewOptions()->IsIgnoreProtectedArea())
if ((IsReadOnlyAvailable() || GetViewOptions()->IsFormView() ||
GetDoc()->GetDocumentSettingManager().get( DocumentSettingId::PROTECT_FORM )) &&
!GetViewOptions()->IsIgnoreProtectedArea())
{
if ( m_pTableCursor != nullptr )
{