Apache OpenOffice (AOO) Bugzilla – Issue 119652
[From Symphony][Crash]When press "Ctrl+Shift+Backspace" in table cell "A1" ,Undo,crash
Last modified: 2022-10-28 12:54:30 UTC
Build: AOO3.4 OS: Windows/LInux Steps: 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
Created attachment 78230 [details] patch_in_DeleteSel_to_fix_this_issue 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.
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. Resolution: 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.
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.
verified on the AOO4.5_r1374181
set Target Milestone to AOO 3.5.0 for PM purpose.
*** Issue 119919 has been marked as a duplicate of this issue. ***
This fix cause bug 121925. Thus, I working on a different solution. This solution will avoid the invalid selection.
"orw" committed SVN revision 1497265 into trunk: 119652: avoid invalid selection on Delete-To-Start-Of-Sentence action
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