Kaydet (Commit) 9995daad authored tarafından Jian Hong Cheng's avatar Jian Hong Cheng

Fix issue #i119652: When press "Ctrl+Shift+Backspace" in table cell "A1" ,Undo,crash

* sw/source/core/edit/eddel.cxx
range invalid

Patch by: Lin Yuan,<yuanlin.ibm@gmail.com>
Found by: Yan Ji,<yanji.yj@gmail.com>
Review by: Jian Hong Cheng,<chengjh@apache.org>           
üst 5c8fe1da
......@@ -57,7 +57,10 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
// 1. Point und Mark stehen in einer Box, Selection normal loeschen
// 2. Point und Mark stehen in unterschiedlichen Boxen, alle
// selektierten Boxen suchen in den Inhalt loeschen
if( rPam.GetNode()->FindTableNode() &&
//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() )
{
......@@ -72,7 +75,11 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
do {
aDelPam.SetMark();
SwNode* pNd = aDelPam.GetNode();
const SwNode& rEndNd = *pNd->EndOfSectionNode();
//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();
if( pEndSelPos->nNode.GetIndex() <= rEndNd.GetIndex() )
{
*aDelPam.GetPoint() = *pEndSelPos;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment