diff options
author | Oliver-Rainer Wittmann <orw@apache.org> | 2013-06-27 09:41:05 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-06-27 13:45:42 +0100 |
commit | e6cd5d0b11e7d8562358b883c08a8dba9fd4f61d (patch) | |
tree | 8bae4462fbb080228ce67af8c5f5d4c25c867157 /sw/source/ui/wrtsh | |
parent | 09650703d3a6f8e579d2d822fbb59de0da8c070e (diff) |
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
Diffstat (limited to 'sw/source/ui/wrtsh')
-rw-r--r-- | sw/source/ui/wrtsh/delete.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh4.cxx | 5 |
2 files changed, 14 insertions, 3 deletions
diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx index f19455e0d681..940a41148087 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 6966e45c4fda..62772766fc4a 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() |