sw/source/core/edit/eddel.cxx | 21 +++++++-------------- sw/source/ui/wrtsh/delete.cxx | 12 +++++++++++- sw/source/ui/wrtsh/wrtsh4.cxx | 11 ++++++----- 3 files changed, 24 insertions(+), 20 deletions(-)
New commits: commit be6ce149c164d8ac06f12a4a1cc04a9299f5fd07 Author: Oliver-Rainer Wittmann <o...@apache.org> Date: Thu Jun 27 09:56:32 2013 +0000 121925: fixed by reverting change for issue 119652 diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index 3527ec4..3906b59 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -47,8 +47,8 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo ) { - // nur bei Selektion - if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark()) + // only on a selection + if ( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark()) return; // besteht eine Selection in einer Tabelle ? @@ -58,11 +58,8 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo ) // 2. Point und Mark stehen in unterschiedlichen Boxen, alle // selektierten Boxen suchen in den Inhalt loeschen - //Comment:If the point is outside of a table and the mark point is in the a table cell, - // should go throw the following code - if( (rPam.GetNode()->FindTableNode() || rPam.GetNode(sal_False)->FindTableNode()) && - rPam.GetNode()->StartOfSectionNode() != - rPam.GetNode(sal_False)->StartOfSectionNode() ) + if( rPam.GetNode()->FindTableNode() && + rPam.GetNode()->StartOfSectionNode() != rPam.GetNode(sal_False)->StartOfSectionNode() ) { // in Tabellen das Undo gruppieren if( pUndo && !*pUndo ) @@ -75,11 +72,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo ) do { aDelPam.SetMark(); SwNode* pNd = aDelPam.GetNode(); - //Comment:If the point is outside of table, select the table start node as the end node of current selection node - const SwNode& rEndNd = !rPam.GetNode()->FindTableNode() && !pNd->FindTableNode()? - *(SwNode*)(rPam.GetNode(sal_False)->FindTableNode()) - : - *pNd->EndOfSectionNode(); + const SwNode& rEndNd = *pNd->EndOfSectionNode(); if( pEndSelPos->nNode.GetIndex() <= rEndNd.GetIndex() ) { *aDelPam.GetPoint() = *pEndSelPos; @@ -91,7 +84,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo ) aDelPam.GetPoint()->nNode = rEndNd; aDelPam.Move( fnMoveBackward, fnGoCntnt ); } - // geschuetze Boxen ueberspringen ! + // geschuetze Boxen ueberspringen ! //For i117395, in some situation, the node would be hidden or invisible, which makes the frame of it unavailable //So verify it before use it. SwCntntFrm* pFrm = NULL; @@ -111,7 +104,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo ) } else { - // alles loeschen + // alles loeschen GetDoc()->DeleteAndJoin( rPam ); SaveTblBoxCntnt( rPam.GetPoint() ); } commit 562cc00ca57d00a22d56e61c5da307864e5db2f9 Author: Oliver-Rainer Wittmann <o...@apache.org> Date: Thu Jun 27 09:41:05 2013 +0000 119652: avoid invalid selection on Delete-To-Start-Of-Sentence action diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx index 3df0a49..b5608fb 100644 --- a/sw/source/ui/wrtsh/delete.cxx +++ b/sw/source/ui/wrtsh/delete.cxx @@ -478,7 +478,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 e72a0da..648fc6a 100644 --- a/sw/source/ui/wrtsh/wrtsh4.cxx +++ b/sw/source/ui/wrtsh/wrtsh4.cxx @@ -223,19 +223,20 @@ sal_Bool SwWrtShell::_BwdSentence() if(!SwCrsrShell::Left(1,CRSR_SKIP_CHARS)) { Pop(sal_False); - return 0; + return sal_False; } if(IsSttPara()) { Pop(); - return 1; + return sal_True; } if( !GoPrevSentence() && !IsSttPara() ) - // nicht gefunden --> an den Absatz Anfang - SwCrsrShell::MovePara( fnParaCurr, fnParaStart ); + // nicht gefunden --> an den Absatz Anfang + SwCrsrShell::MovePara( fnParaCurr, fnParaStart ); ClearMark(); Combine(); - return 1; + + return sal_True; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits