Apache OpenOffice (AOO) Bugzilla – Issue 121925
Crash when Crtl+Shift+Del at end of table
Last modified: 2017-05-20 11:42:12 UTC
In AOO3.4.1 it is possible to delete the paragraph which follows a table by going to end of right, bottom cell and then press Ctrl+Shift+Delete. If you do this in AOO4.0dev, it crashes. I know from bug 94879, that deleting the paragraph is currently not persistent over save - reload. But you need this feature, if you want to merge two tables. Only tables which are adjacent, without paragraph between them can be merged.
.
Crash takes place in SwEditShell::DeleteSel(). In sw/source/core/edit/eddel.cxx:82 where a NULL reference is accessed. This reference is created on the lines directly above probably from a NULL pointer that is not checked.
set showstopper flag
ALG: Ollks like in SwEditShell::DeleteSel the SwNode rEndNd gets deleted (since it's a forward delete), but the method is not prepared the rEndNd to get zero (what it gets). Checking further...
ALG: Grepping, preparing possible solution
Created attachment 80905 [details] Possible solution ALG: With the added patch the crash is gone. The action deletes the table, and UNDO adds it again. Checked with Symphony; does also not happen there. in sw/source/core/edit/eddel.cxx it has various extensions in SwEditShell::DeleteSel, see xAdjustCursorForSpecialSelection and others. The result of the action is the same, the table gets deleted, UNDO brings it back. Only diff is that the selection is on all 4 table cells, while with my patch it's only in the first. @ORW: Could you have a lok please, you are the SW specialist.
Taking over to review the provided patch
set showstopper flag again
Hi, please check this scenario: Make a table with values and then create a chart, which depends on this table. If I delete the table and then undo it, the table comes back, but the chart looses its connection to the table.
(In reply to Regina Henschel from comment #9) > Hi, please check this scenario: Make a table with values and then create a > chart, which depends on this table. If I delete the table and then undo it, > the table comes back, but the chart looses its connection to the table. Hi Regina, could you please submit a new issue for this problem. Thx in advance.
It is not about a new issue, but when the patch is applied, it should be possible to use Ctrl-Shift-Del and does not loose the chart. It is possible in AOO3.4.1. I'm cautious because Armin wrote "The result of the action is the same, the table gets deleted, UNDO brings it back." and therefore tested what a direct table delete and undo does. I have applied the patch to r1492861 and now it does not crash, but the table is completely deleted. It is a debug build and not clean, so it might work nevertheless.
The result of Ctrl-Shift-Del at the end of table should delete the paragraph following the table. Thus, if the patch deletes the table by Ctrl-Shift-Del, then it does not solve the crash correctly.
Same wrong behavior with a clean build of r1492861 :(
defect introduced by fix for bug 119652
I reverted in my local environment the fix of bug 119652. --> this issue is fixed and bug 119652 also does not occur. I will attach a corresponding patch. I also could not reproduce bug 119652 in AOO 3.4. Regina: Could you do me a favor and verify my patch and also check, if bug 119652 is still solved? Thx in advance. (no clean build will be needed for this patch.)
Created attachment 80915 [details] patch to revert changes from issue 119652
Hi Oliver, I have applied your new patch. Result: This issue: Ctrl-Shift-Del works without problems to delete paragraph after table. Undo the action works correct. I have tested in addition, whether a chart is effected. It is not, charts retain their data range reference. Bug 119652: Ctrl-Shift-Backspace is connected to the action "Delete to paragraph start". This works, when there is text in cell A1. But when cell A1 is empty, the command deletes the text before the cell and leaves the cell A1 in a wrong state. Cell A1 is not reachable, neither with mouse nor with arrow keys or tab key and it has no pilcrow sign. Undo in this state gives a second paragraph in cell B1 and assertions: Error: Assertion failed ================== FILE : c:/AOO_2013_06_08/trunk/main/sw/source/core/frmedt/tblsel.cxx at line 1854 ERROR : "MakeSelUnions with pStart or pEnd not in CellFrm" followed by endless assertions: Error: Assertion failed ================== FILE : c:/AOO_2013_06_08/trunk/main/sw/source/core/crsr/trvltbl.cxx at line 754 ERROR : "kein Frame zur Box" Error: C++ exception caught!
(In reply to Regina Henschel from comment #17) > Hi Oliver, I have applied your new patch. Result: > This issue: > Ctrl-Shift-Del works without problems to delete paragraph after table. Undo > the action works correct. I have tested in addition, whether a chart is > effected. It is not, charts retain their data range reference. > > Bug 119652: > Ctrl-Shift-Backspace is connected to the action "Delete to paragraph start". > This works, when there is text in cell A1. But when cell A1 is empty, the > command deletes the text before the cell and leaves the cell A1 in a wrong > state. Cell A1 is not reachable, neither with mouse nor with arrow keys or > tab key and it has no pilcrow sign. Undo in this state gives a second > paragraph in cell B1 and assertions: > > Error: Assertion failed > ================== > FILE : c:/AOO_2013_06_08/trunk/main/sw/source/core/frmedt/tblsel.cxx > at line 1854 > ERROR : "MakeSelUnions with pStart or pEnd not in CellFrm" > > followed by endless assertions: > > Error: Assertion failed > ================== > FILE : c:/AOO_2013_06_08/trunk/main/sw/source/core/crsr/trvltbl.cxx at > line 754 > ERROR : "kein Frame zur Box" > Error: C++ exception caught! Regina, thank your very much. You opened my eyes. I tried to reproduce 119652 by hitting Ctrl-Shift-Del. Somehow I was not able to read. Thus, I am back at the code to fix both issues.
I have found a solution. I will revert the changes of bug 119652 to fix this issue. Bug 119652 will be fixed with a different solution.
"orw" committed SVN revision 1497274 into trunk: 121925: fixed by reverting change for issue 119652
fixed on trunk for AOO 4.0 by reverting the changes from bug 119652 - revision 1497274 Regina: It would be great, if you could have a look and could verify this fix and the new fix for 119652. Thx in advance.
I have build r1497734 on Windows 7. Ctrl+Shift+Del at end of table now works without crash and as it should. For Bug 119652: Ctrl+Shift+Backspace works without any assertion and as it should. Undo works at is should. No problems with charts based on that table. So fix verified for r1497734 for Windows 7.
(In reply to Regina Henschel from comment #22) > I have build r1497734 on Windows 7. Ctrl+Shift+Del at end of table now works > without crash and as it should. > > For Bug 119652: Ctrl+Shift+Backspace works without any assertion and as it > should. Undo works at is should. > > No problems with charts based on that table. > > So fix verified for r1497734 for Windows 7. Thx for the verification