[Libreoffice-commits] .: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 14 05:40:11 PST 2013


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

New commits:
commit 50b6dc0099ff61050b82a2e37e70d643151e7ce7
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Jan 14 10:55:55 2013 +0100

    fdo#57938 SwPaM::HasReadonlySel allow editing before commented text ranges
    
    Change-Id: I229602e7783c76e7fc57b78a408f90c1f6a8cda5

diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 8000052..5fbf4bc 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -700,6 +700,13 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
             if (!bUnhandledMark)
                 bCommentrangeMark = pFieldmark->GetFieldname() == ODF_COMMENTRANGE;
         }
+        // Allow editing selection right before a commented range.
+        if (!bCommentrangeMark && GetMark())
+        {
+            pFieldmark = pMarksAccess->getFieldmarkFor(*GetMark());
+            if (pFieldmark)
+                bCommentrangeMark = pFieldmark->GetFieldname() == ODF_COMMENTRANGE;
+        }
     }
 
     if (!bRet)
@@ -708,7 +715,7 @@ sal_Bool SwPaM::HasReadonlySel( bool bFormView ) const
         if ( ( pA == pB ) && bUnhandledMark )
             bRet = sal_True;
         // Allow editing of commented ranges.
-        else if (!((pA == pB) && bCommentrangeMark))
+        else if (!bCommentrangeMark)
         {
             // Form protection case
             bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();


More information about the Libreoffice-commits mailing list