[Libreoffice-commits] .: Branch 'libreoffice-4-0' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 11 03:02:23 PST 2013


 sw/source/core/crsr/pam.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 5a0dc1d1fdeac4b06b39ea616374d3f81b6be8a9
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Thu Jan 10 16:21:55 2013 +0100

    fdo#57938 SwPaM::HasReadonlySel: commented text ranges are not read-only
    
    (cherry picked from commit fd0da52d371ca13d66be3b04d89f9d9cf73baddd)
    
    Change-Id: I8191ed6383c4c636be67b8d42654dbba0a5c8b6f
    Reviewed-on: https://gerrit.libreoffice.org/1629
    Reviewed-by: Noel Power <noel.power at suse.com>
    Tested-by: Noel Power <noel.power at suse.com>

diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index baf62ad..6d7f07a 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -685,6 +685,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( );
@@ -693,7 +694,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)
@@ -701,7 +706,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();


More information about the Libreoffice-commits mailing list