Issue 119652 - [From Symphony][Crash]When press "Ctrl+Shift+Backspace" in table cell "A1" ,Undo,crash
Summary: [From Symphony][Crash]When press "Ctrl+Shift+Backspace" in table cell "A1" ,U...
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: 3.4.0
Hardware: PC All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: Oliver-Rainer Wittmann
QA Contact:
Depends on: 121925
Blocks: 120823
  Show dependency tree
Reported: 2012-06-01 02:49 UTC by Yan Ji
Modified: 2013-06-27 09:46 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

patch_in_DeleteSel_to_fix_this_issue (1.31 KB, patch)
2012-06-11 08:45 UTC, yuanlin review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-06-01 02:49:43 UTC
Build: AOO3.4
OS: Windows/LInux
1. New Word Process document.
2. Create a paragraph.
3. Create a table(with default properties) and put cursor inside "A1" cell.
4. Press "Ctrl+Shift+Backspace"
5. Undo

Defect: Application crashed
Comment 1 yuanlin 2012-06-11 08:45:28 UTC
Created attachment 78230 [details]

When delete the content by "ctrl+shift+backspace" in the beginning of a table, it will delete a PaM with the Mark in the first cell of the table and the Point is outside the table. In this case, we should delete the content outside of table firstly and then go to the first table cell to delete the other content.
Comment 2 yuanlin 2012-06-19 08:58:42 UTC
Root cause:
When user press "ctrl+shift+backspace" at the beginning of a table, AOO will delete the paragraph before the table. It will create a PaM with the Mark in the first cell of the table and the Point is the text node before the table. And will call SwEditShell::DeleteSel() to delete the PaM. However, in SwEditShell::DeleteSel(), the whole PaM will be deleted directly. More node will be deleted and when do undo it will cause strange error later.

In SwEditShell::DeleteSel(), there is code to delete multi cell selection in a table. It will split the content according to the cell selection delete them one by one. The fix can re-use the code that if the PaM is span from inside of a table to outside of the table, split the PaM as two part, that one part is the paragraphs before the table, the other part is the content in the table(could be null in this case). And use the similar logic to delete them.
Comment 3 Jian Hong Cheng 2012-06-21 01:20:46 UTC
Reviewed and Committed with revision:1352384.
Currently,AOO only provides to select within a table or select range containing table(s),not able to select range crossing tables. That means the start and end are locating at different tables,or one is within a table,another is not..The code logic doesn't consider the situations either.This patch will only consider the supported scenarios..other limitations will not be considered here.thanks.
Comment 4 Du Jing 2012-08-21 02:17:04 UTC
verified on the AOO4.5_r1374181
Comment 5 Shenfeng Liu 2012-10-09 09:30:09 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.
Comment 6 liuping 2013-06-20 05:41:57 UTC
*** Issue 119919 has been marked as a duplicate of this issue. ***
Comment 7 Oliver-Rainer Wittmann 2013-06-27 08:11:42 UTC
This fix cause bug 121925.
Thus, I working on a different solution. This solution will avoid the invalid selection.
Comment 8 SVN Robot 2013-06-27 09:41:06 UTC
"orw" committed SVN revision 1497265 into trunk:
119652: avoid invalid selection on Delete-To-Start-Of-Sentence action
Comment 9 Oliver-Rainer Wittmann 2013-06-27 09:46:34 UTC
Fixed on trunk for AOO 4.0 by avoiding the invalid selection before calling the method to delete the selection.

Now, the former changes can be reverted to solve bug 121925