diff options
-rw-r--r-- | sw/source/core/crsr/pam.cxx | 8 |
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(); |