[Libreoffice-commits] core.git: sw/source

Oliver-Rainer Wittmann orw at apache.org
Thu Jun 27 05:46:04 PDT 2013


 sw/source/ui/wrtsh/delete.cxx |   12 +++++++++++-
 sw/source/ui/wrtsh/wrtsh4.cxx |    5 +++--
 2 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit e6cd5d0b11e7d8562358b883c08a8dba9fd4f61d
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Thu Jun 27 09:41:05 2013 +0000

    Resolves: #119652# avoid invalid selection on...
    
    Delete-To-Start-Of-Sentence action
    
    (cherry picked from commit 562cc00ca57d00a22d56e61c5da307864e5db2f9)
    
    Conflicts:
    	sw/source/ui/wrtsh/wrtsh4.cxx
    
    Change-Id: I56e104792f28b462327a53d243baa6c1413b3099

diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index f19455e..940a411 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -446,7 +446,17 @@ long SwWrtShell::DelToStartOfSentence()
     if(IsStartOfDoc())
         return 0;
     OpenMark();
-    long nRet = _BwdSentence() ? Delete() : 0;
+
+    SwCrsrSaveState aSaveState( *(_GetCrsr()) );
+    sal_Bool bSuccessfulSelection = _BwdSentence();
+    if ( _GetCrsr()->IsInProtectTable( sal_True )
+         || _GetCrsr()->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
+                                  nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ) )
+    {
+        bSuccessfulSelection = sal_False;
+    }
+    long nRet = bSuccessfulSelection ? Delete() : 0;
+
     CloseMark( 0 != nRet );
     return nRet;
 }
diff --git a/sw/source/ui/wrtsh/wrtsh4.cxx b/sw/source/ui/wrtsh/wrtsh4.cxx
index 6966e45..6277276 100644
--- a/sw/source/ui/wrtsh/wrtsh4.cxx
+++ b/sw/source/ui/wrtsh/wrtsh4.cxx
@@ -198,14 +198,15 @@ sal_Bool SwWrtShell::_BwdSentence()
     if(!SwCrsrShell::Left(1,CRSR_SKIP_CHARS))
     {
         Pop(sal_False);
-        return 0;
+        return sal_False;
     }
     if( !GoStartSentence()  && !IsSttPara() )
             // not found --> go to the beginning of the paragraph
         SwCrsrShell::MovePara( fnParaCurr, fnParaStart );
     ClearMark();
     Combine();
-    return 1;
+
+    return sal_True;
 }
 
 sal_Bool SwWrtShell::_FwdPara()


More information about the Libreoffice-commits mailing list