summaryrefslogtreecommitdiff
path: root/sw/source/core/crsr/pam.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-14 18:42:52 +0100
committerPetr Mladek <pmladek@suse.cz>2013-02-18 19:24:06 +0000
commit806403f366f5cdfbb73438dd4004ed6c8fbd696d (patch)
treed2feabb44679dea58ca694124dbcf2205ce29a31 /sw/source/core/crsr/pam.cxx
parent7ae175f5e818100fe6aecaecc8da7701c05c6a6b (diff)
fdo#60738 SwPostItMgr: let the cursor know if we're in annotation mode
This solves the conflicting requirements: If the annotation has focus ("in annotation mode"), then we want to be read-only only in case the comment anchor is inside a protected section, or so. Ignoring the fact that in the main document, the cursor is right before the annotation anchor, which is a read-only position. OTOH, if the annotation has no focus and the cursor position is before the annotation anchor position, then we do want to be read-only. With this commit, the first case passes around a boolean flag, so the annotation frame won't be read-only without a reason. (cherry picked from commit 9104d5e8905c2ec2b576b5ca452d3e23d5555e49) Conflicts: sw/inc/pam.hxx sw/source/core/crsr/pam.cxx Change-Id: I25781a4501f752f7c4d024795d57b884cb800547 Reviewed-on: https://gerrit.libreoffice.org/2163 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'sw/source/core/crsr/pam.cxx')
-rw-r--r--sw/source/core/crsr/pam.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index e745e80d75d9..c36b5820c2d4 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -589,7 +589,7 @@ static const SwFrm* lcl_FindEditInReadonlyFrm( const SwFrm& rFrm )
}
/// is in protected section or selection surrounds something protected
-sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
+sal_Bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const
{
sal_Bool bRet = sal_False;
Point aTmpPt;
@@ -731,8 +731,8 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
}
// Don't allow inserting characters between the 'field mark end' and
- // the 'comment anchor'.
- if (!bRet)
+ // the 'comment anchor', unless the cursor is inside the annotation.
+ if (!bRet && !bAnnotationMode)
{
if (!pA && GetPoint() && GetPoint()->nNode.GetNode().IsTxtNode() && GetPoint()->nContent.GetIndex() > 0)
{