Author: chengjh
Date: Thu Jun 21 01:13:36 2012
New Revision: 1352384

URL: http://svn.apache.org/viewvc?rev=1352384&view=rev
Log:
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,<[email protected]>
Found by: Yan Ji,<[email protected]>
Review by: Jian Hong Cheng,<[email protected]>           

Modified:
    incubator/ooo/trunk/main/sw/source/core/edit/eddel.cxx

Modified: incubator/ooo/trunk/main/sw/source/core/edit/eddel.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/edit/eddel.cxx?rev=1352384&r1=1352383&r2=1352384&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/edit/eddel.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/edit/eddel.cxx Thu Jun 21 01:13:36 
2012
@@ -57,7 +57,10 @@ void SwEditShell::DeleteSel( SwPaM& rPam
        //      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
                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;


Reply via email to