Issue 119956 - [From Symphony]Crash if undo redo creating data pilot from imported data
[From Symphony]Crash if undo redo creating data pilot from imported data
Status: CLOSED FIXED
Product: Calc
Classification: Application
Component: editing
3.4.0
PC All
: P3 critical (vote)
: 4.0.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-12 07:07 UTC by Yan Ji
Modified: 2012-11-07 08:42 UTC (History)
3 users (show)

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


Attachments
sample (17.67 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-06-12 07:07 UTC, Yan Ji
no flags Details
Fix patch for Bug 119956 (2.01 KB, patch)
2012-06-13 05:25 UTC, pengyunquan
yunquanp: review?
Details | Diff
Fix patch for Bug 119956 (2.01 KB, patch)
2012-06-13 05:50 UTC, pengyunquan
yunquanp: 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 07:07:47 UTC
Created attachment 78250 [details]
sample

Build: AOO3.4
Steps:
1. New a Spreadsheet document
2. From menu "Insert->Sheets from File"
3. Select attached sample file and select all sheet to import
4. Select Data in sheet A to create pivot Table via menu "Data->Pivot Table->Create"
5. In Pivot Table dialog, click "More" button
6. Select "- new sheet" for "Results to"
7. Drag one filed to either layout/Column/Row/Dat field, click "OK"
8. Undo three times
9. Redo three times

Defect: Application crashed
Comment 1 Yan Ji 2012-06-12 07:30:45 UTC
Change product
Comment 2 pengyunquan 2012-06-13 05:25:56 UTC
Created attachment 78276 [details]
Fix patch for Bug 119956

Root Cause : A rule in calc is that inserting a sheet should enable DrawUndo first, because inserting a new sheet will cause a new ScDrawPage being inserted into SdrModel, and this action should be managed by DrawUndo. But on creation of PivotTable, this rule is not obeyed. When creating PivotTable on new sheet, a new sheet is inserted without enablement of DrawUndo. As a result, when undo the creation of PivotTable, the new sheet is removed but the SdrModel is not by synchronized because it's the DrawUndo's responsibility to do the synchronization but DrawUndo is not recorded. When inserting sheets from file for the 2nd time, the undo list is cleared and some ScDrawPage should be destroyed, but as stated above the ScDrawPage is not correctly maintained when undo the creation of PivotTable, so incorrect ScDrawPage is destroyed and cause dead object access later. 

Solution : Enable DrawUndo before inserting a new sheet on creation of PivotTable
Comment 3 pengyunquan 2012-06-13 05:50:01 UTC
Created attachment 78280 [details]
Fix patch for Bug 119956
Comment 4 Wang Lei 2012-06-14 06:26:11 UTC
At first I can not reproduce this bug. Then I find how to reproduce. The reproduce steps should be

Steps:
1. New a Spreadsheet document
2. From menu "Insert->Sheets from File"
3. Select attached sample file and select all sheet to import
4. Select Data in sheet A to create pivot Table via menu "Data->Pivot Table->Create"
5. In Pivot Table dialog, click "More" button
6. Select "- new sheet" for "Results to"
7. Drag one filed to either layout/Column/Row/Dat field, click "OK"
8. Undo three times
9. Redo three times
10. At this time, you may see the redo button is disable. Enter Ctrl+Y again

AOO3.4 will crash
Comment 5 Wang Lei 2012-06-14 06:46:22 UTC
Reviewed.  Patch looks good.
Thanks for the good work.
Applied on SVN revision 1350103
Comment 6 Wang Lei 2012-06-21 02:34:06 UTC
Fixed in revision 1350103
Comment 7 binguo 2012-08-20 09:46:33 UTC
Verified on latest AOO Trunk 0817 build on Window OS/Linux OS/Linux 64bit OS, this bug is fixed. No crash occurs again when undo/redo.
Comment 8 Shenfeng Liu 2012-11-07 08:42:29 UTC
corrected the Target Milestone to AOO 3.5.0.