Issue 119686 - Undo operation lead to crash when editing xls file.
Undo operation lead to crash when editing xls file.
Status: CLOSED FIXED
Product: Calc
Classification: Application
Component: editing
3.4.0
PC All
: P3 critical (vote)
: 4.0.0
Assigned To: zhang jianfang
:
Depends on:
Blocks: 120823
  Show dependency treegraph
 
Reported: 2012-06-04 02:12 UTC by Li Lin Yi
Modified: 2012-11-08 05:36 UTC (History)
7 users (show)

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


Attachments
attached xls file. (155.50 KB, application/vnd.ms-excel)
2012-06-04 02:12 UTC, Li Lin Yi
no flags Details
Add patch (821 bytes, patch)
2012-07-10 08:00 UTC, Zhang Lu
orw: review+
Details | Diff
refix code patch (1.11 KB, patch)
2012-08-29 08:23 UTC, zhang jianfang
orw: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Li Lin Yi 2012-06-04 02:12:20 UTC
Created attachment 77897 [details]
attached xls file.

Steps to Reproduce:
1. Open the attached xls file.
2. Edit cell B1 of the default displayed sheet(Sheet2). Such as, you can insert 1 into cell B1.
3. Undo several times.

Actual Results: 
You can only undo once and the file keeps the same as it is before.

Expected Results:
Although you just edited the file once, there were 3 undo operations in the undo list(click the down arrow of the undo button in the toolbar). Undo 3 times, the file crashed.

Build Date & Platform:
Build revision is Rev. 1327774, first found on win xp.
Comment 1 binguo 2012-06-12 09:10:32 UTC
This bug can repros on AOO3.4.O Rev. 1327774,
and I change the status from Unconfirmed to confirmed.
Comment 2 Wang Lei 2012-06-28 22:17:36 UTC
(In reply to comment #0)
> Created attachment 77897 [details]
> attached xls file.
> 
> Steps to Reproduce:
> 1. Open the attached xls file.
> 2. Edit cell B1 of the default displayed sheet(Sheet2). Such as, you can
> insert 1 into cell B1.
> 3. Undo several times.
> 
This should be Expected Result:
> Actual Results: 
> You can only undo once and the file keeps the same as it is before.
> 

This should be Actual Result
> Expected Results:
> Although you just edited the file once, there were 3 undo operations in the
> undo list(click the down arrow of the undo button in the toolbar). Undo 3
> times, the file crashed.
> 
> Build Date & Platform:
> Build revision is Rev. 1327774, first found on win xp.
Comment 3 Zhang Lu 2012-07-10 08:00:33 UTC
Created attachment 78613 [details]
Add patch

I'm working on this defect,
root cause:
This defect is brought from issue 73249, an old defect, which added undo/redo mechanism on function SetName()/SetTitile()/SetDescription() of sdr object.
When loading sdr object from MS Excel, sdr module is undo enable status, SetName() will be called here, so a needless undo action is added to undo-manager.

Solution:
set sdr module as undo disable status before call these functions.
Comment 4 Oliver-Rainer Wittmann 2012-07-10 12:31:51 UTC
taking over for reviewing the patch
Comment 5 Oliver-Rainer Wittmann 2012-07-11 09:33:53 UTC
Comment on attachment 78613 [details]
Add patch

Review done. Patch looks good and solves the problem.
--> I will apply the patch on trunk.
Comment 6 SVN Robot 2012-07-11 11:10:24 UTC
"orw" committed SVN revision 1360123 into trunk:
#119686# - method <XclImpDrawObjBase::PreProcessSdrObject(..)> - disable Undo...
Comment 7 Oliver-Rainer Wittmann 2012-07-11 11:10:49 UTC
patch applied on trunk.
Comment 8 zhang jianfang 2012-08-29 08:19:48 UTC
Reopen the bug since the fix code cause crashes in some cases.
Comment 9 zhang jianfang 2012-08-29 08:23:12 UTC
Created attachment 79212 [details]
refix code patch

Need add SdrModel pointer check code.
Comment 10 Oliver-Rainer Wittmann 2012-08-29 08:42:15 UTC
Comment on attachment 79212 [details]
refix code patch

This correction of the initial patch makes sense.
+1 from my side to apply this correction.
Comment 11 Oliver-Rainer Wittmann 2012-08-29 08:43:36 UTC
assigning issue to zhang jianfang for further handling.
Comment 12 SVN Robot 2012-08-29 14:17:18 UTC
"zhangjf" committed SVN revision 1378570 into trunk:
#i119686#, refix, add SdrModel pointer check to avoid crashes in some casesFo...
Comment 13 zhang jianfang 2012-08-29 14:50:20 UTC
Set as resolved again.
Comment 14 Shenfeng Liu 2012-11-07 08:54:43 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.
Comment 15 Li Feng Wang 2012-11-08 05:36:35 UTC
Can't reproduce on trunk r1404513. Verify pass.