Issue 121925 - Crash when Crtl+Shift+Del at end of table
Summary: Crash when Crtl+Shift+Del at end of table
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: 4.0.0-dev
Hardware: PC Windows 7
: P3 Major (vote)
Target Milestone: 4.0.0
Assignee: Oliver-Rainer Wittmann
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 119652
  Show dependency tree
 
Reported: 2013-03-20 17:44 UTC by Regina Henschel
Modified: 2017-05-20 11:42 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---
jsc: 4.0.0_release_blocker+


Attachments
Possible solution (1.24 KB, patch)
2013-06-24 14:24 UTC, Armin Le Grand
no flags Details | Diff
patch to revert changes from issue 119652 (5.14 KB, patch)
2013-06-26 09:49 UTC, Oliver-Rainer Wittmann
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2013-03-20 17:44:38 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.
Comment 1 Oliver Brinzing 2013-03-21 05:32:21 UTC
.
Comment 2 Andre 2013-06-18 09:38:53 UTC
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.
Comment 3 jsc 2013-06-24 12:17:24 UTC
set showstopper flag
Comment 4 Armin Le Grand 2013-06-24 12:49:56 UTC
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...
Comment 5 Armin Le Grand 2013-06-24 14:16:25 UTC
ALG: Grepping, preparing possible solution
Comment 6 Armin Le Grand 2013-06-24 14:24:58 UTC
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.
Comment 7 Oliver-Rainer Wittmann 2013-06-24 14:30:37 UTC
Taking over to review the provided patch
Comment 8 jsc 2013-06-24 14:36:53 UTC
set showstopper flag again
Comment 9 Regina Henschel 2013-06-24 14:42:32 UTC
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.
Comment 10 Oliver-Rainer Wittmann 2013-06-24 15:41:29 UTC
(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.
Comment 11 Regina Henschel 2013-06-24 16:33:31 UTC
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.
Comment 12 Oliver-Rainer Wittmann 2013-06-25 08:54:03 UTC
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.
Comment 13 Regina Henschel 2013-06-25 12:57:35 UTC
Same wrong behavior with a clean build of r1492861 :(
Comment 14 Oliver-Rainer Wittmann 2013-06-26 06:59:54 UTC
defect introduced by fix for bug 119652
Comment 15 Oliver-Rainer Wittmann 2013-06-26 09:43:45 UTC
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.)
Comment 16 Oliver-Rainer Wittmann 2013-06-26 09:49:04 UTC
Created attachment 80915 [details]
patch to revert changes from issue 119652
Comment 17 Regina Henschel 2013-06-26 13:01:42 UTC
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!
Comment 18 Oliver-Rainer Wittmann 2013-06-26 13:13:40 UTC
(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.
Comment 19 Oliver-Rainer Wittmann 2013-06-27 08:17:54 UTC
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.
Comment 20 SVN Robot 2013-06-27 10:00:07 UTC
"orw" committed SVN revision 1497274 into trunk:
121925: fixed by reverting change for issue 119652
Comment 21 Oliver-Rainer Wittmann 2013-06-27 10:01:55 UTC
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.
Comment 22 Regina Henschel 2013-06-29 11:38:43 UTC
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.
Comment 23 Oliver-Rainer Wittmann 2013-07-01 10:31:16 UTC
(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