summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-01-10 16:21:55 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-01-10 16:23:25 +0100
commitfd0da52d371ca13d66be3b04d89f9d9cf73baddd (patch)
tree0f1263be4a4fe20c16bfec300551e624a3992b00
parentda09115cffeca384ab91ffe4d7af4d8eab6cee82 (diff)
fdo#57938 SwPaM::HasReadonlySel: commented text ranges are not read-only
-rw-r--r--sw/source/core/crsr/pam.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index e9b78020808e..8000052414e8 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -686,6 +686,7 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
sw::mark::IMark* pA = NULL;
sw::mark::IMark* pB = NULL;
bool bUnhandledMark = false;
+ bool bCommentrangeMark = false;
if ( pDoc )
{
const IDocumentMarkAccess* pMarksAccess = pDoc->getIDocumentMarkAccess( );
@@ -694,7 +695,11 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
sw::mark::IFieldmark* pFieldmark = pMarksAccess->getFieldmarkFor( *GetPoint() );
if ( pFieldmark )
+ {
bUnhandledMark = pFieldmark->GetFieldname( ) == ODF_UNHANDLED;
+ if (!bUnhandledMark)
+ bCommentrangeMark = pFieldmark->GetFieldname() == ODF_COMMENTRANGE;
+ }
}
if (!bRet)
@@ -702,7 +707,8 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
// Unhandled fieldmarks case shouldn't be edited manually to avoid breaking anything
if ( ( pA == pB ) && bUnhandledMark )
bRet = sal_True;
- else
+ // Allow editing of commented ranges.
+ else if (!((pA == pB) && bCommentrangeMark))
{
// Form protection case
bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();