Issue 119953 - [From Symphony]Undo redo insert file cause application crashed
[From Symphony]Undo redo insert file cause application crashed
Status: CLOSED FIXED
Product: Writer
Classification: Application
Component: editing
3.4.0
PC All
: P3 critical (vote)
: 4.0.0
Assigned To: Oliver-Rainer Wittmann
:
Depends on:
Blocks: 120823
  Show dependency treegraph
 
Reported: 2012-06-12 06:34 UTC by Yan Ji
Modified: 2012-10-09 09:37 UTC (History)
5 users (show)

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


Attachments
sample (27.50 KB, application/msword)
2012-06-12 06:34 UTC, Yan Ji
no flags Details
patch for bug 119953 (12.73 KB, patch)
2012-06-26 02:13 UTC, Chen Peng
orw: review-
Details | Diff
alternative patch which also improves the consistency of "Insert - File" function (2.33 KB, patch)
2012-07-05 13:21 UTC, Oliver-Rainer Wittmann
awf.aoo: 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-12 06:34:58 UTC
Created attachment 78247 [details]
sample

Build: AOO3.4
Steps:
1. New a text document
2. From menu "Insert->File"
3. Select sample file to insert
4. Undo/Redo

Defect: Application crashed.
Comment 1 Chen Peng 2012-06-14 03:13:26 UTC
I will take over this bug.
Comment 2 Chen Peng 2012-06-26 02:13:58 UTC
Created attachment 78473 [details]
patch for bug 119953
Comment 3 Chen Peng 2012-06-26 02:15:50 UTC
Root Cause:
    In the procedure of inserting file, a text node split and a text node join action did not have corresponding undo recorded.

Resolution:
    Add said undo action if necessary.
Comment 4 Oliver-Rainer Wittmann 2012-07-05 08:44:44 UTC
taking over for reviewing patch
Comment 5 Oliver-Rainer Wittmann 2012-07-05 09:27:23 UTC
Performing the steps to reproduce the crash does not result in a crash.
But, I am recognizing that after the step 4 one empty paragraph is missing.
Performing another Undo after step 4 results in a crash.

Yan Ji and/or Chen Peng: Can you confirm my observation?
Comment 6 Oliver-Rainer Wittmann 2012-07-05 11:39:20 UTC
I have done some further tests:
(A) If the sample document is not inserted at the very first and empty paragraph, very thing works fine.
(B) If I convert the sample document (it is a Microsoft Word document in binary file format) to an ODF text document and use this ODF text document, I can _not_ reproduce the crash. I also recognized in this scenario that it differs. In general the file is inserted on a new page. This is not the case with the sample document, when it is inserted while the cursor is in the first empty paragraph.

Yan Ji and/or Chen Peng: Can you confirm my observation?

Thus, I think the problem can be also solved to make the "file insert" action consistent.
Comment 7 Oliver-Rainer Wittmann 2012-07-05 13:21:42 UTC
Created attachment 78586 [details]
alternative patch which also improves the consistency of "Insert - File" function

Comparing what happen regarding text node splits on inserting Microsoft Word document and ODF text documents I have found a simpler solution for this crash. This solution will also assure better consistency of the "Insert - File" function.
Comment 8 Oliver-Rainer Wittmann 2012-07-05 13:22:44 UTC
Comment on attachment 78473 [details]
patch for bug 119953

review done - marking with '-' in favor of alternative patch
Comment 9 Chen Peng 2012-07-09 03:01:52 UTC
(In reply to comment #5)
> Performing the steps to reproduce the crash does not result in a crash.
But,
> I am recognizing that after the step 4 one empty paragraph is missing.
> Performing another Undo after step 4 results in a crash.
Yes, I can confirm, a paragraph is missing, and in Step 4, it should be undo-redo-undo to reproduce this crach
Yan Ji and/or Chen
> Peng: Can you confirm my observation?
Comment 10 Chen Peng 2012-07-09 03:09:07 UTC
(In reply to comment #6)
> I have done some further tests:
(A) If the sample document is not inserted
> at the very first and empty paragraph, very thing works fine.

When I perform the undo/redo several times, AOO will be freezed.

(B) If I
> convert the sample document (it is a Microsoft Word document in binary file
> format) to an ODF text document and use this ODF text document, I can _not_
> reproduce the crash. I also recognized in this scenario that it differs. In
> general the file is inserted on a new page. This is not the case with the
> sample document, when it is inserted while the cursor is in the first empty
> paragraph.

Yes, I agree with you.

Yan Ji and/or Chen Peng: Can you confirm my observation?

Thus,
> I think the problem can be also solved to make the "file insert" action
> consistent.
Comment 11 SVN Robot 2012-07-09 16:08:59 UTC
"af" committed SVN revision 1359246:
#i119953# Fixed crash on File->Insert.
Comment 12 Andre 2012-07-09 16:09:12 UTC
Comment on attachment 78586 [details]
alternative patch which also improves the consistency of "Insert - File" function

Review OK.
Comment 13 Andre 2012-07-09 16:09:40 UTC
Setting status to fixed.
Comment 14 Du Jing 2012-08-20 07:56:43 UTC
verified on the AOO3.5
Comment 15 Shenfeng Liu 2012-10-09 09:37:33 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.