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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 14 10:52:33 PST 2013


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

New commits:
commit f39fa5aad48dc93bf24a328297635e5e46a65cff
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
    
    (cherry picked from commit 50b6dc0099ff61050b82a2e37e70d643151e7ce7)
    
    Change-Id: I229602e7783c76e7fc57b78a408f90c1f6a8cda5
    Reviewed-on: https://gerrit.libreoffice.org/1673
    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 6d7f07a..e122212 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -699,6 +699,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)
@@ -707,7 +714,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