Issue 119912 - [From Symphony]Crash when redo split the pasted table
[From Symphony]Crash when redo split the pasted table
Status: CLOSED FIXED
Product: Writer
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-08 06:05 UTC by Yan Ji
Modified: 2012-10-09 09:39 UTC (History)
4 users (show)

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


Attachments
patch for bug 119912 Crash when redo split the pasted table (1.25 KB, patch)
2012-06-08 06:47 UTC, Chen Peng
no flags Details | Diff
Repatch 19912 (1.60 KB, patch)
2012-06-08 09:50 UTC, Chen Peng
chenpeng2006: review? (jsc)
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-06-08 06:05:52 UTC
Build: AOO3.4
Steps:
1. New wordprocessor document
2. Create a default table, input some texts into the table, then create a chart based on the table.
3. Press "Ctrl+A" to select all, press "Ctrl+C" to copy.
4. New another SW doc, press "Ctrl+V" to paste.
5. Move focus to cell: A2, split table via "Table->Split Table".
6. Undo 2 times, then redo 2 times then check.

Defect: Application crashed
Comment 1 Chen Peng 2012-06-08 06:46:13 UTC
Root Cause:
Chart data was disposed while undo the pasting, and the corresponding table also has already been destructed, so it can not notify its owner chart data provider to dismiss the chart data sequence, as the code below:
--------------------------------------------------------------------------------
       if (pDataProvider)
        {
            const SwTable* pTable = SwTable::FindTable( GetFrmFmt() );
            if (pTable)
            {
                uno::Reference< chart2::data::XDataSequence > xRef( dynamic_cast< chart2::data::XDataSequence * >(this), uno::UNO_QUERY );
                pDataProvider->RemoveDataSequence( *pTable, xRef );
            }
--------------------------------------------------------------------------------
After all redo happens, the table will be split again, there is an invalidate chart data sequence inside, then the DisposedException lead the crash.

Resolution:
While deleting any box from chart data provider, verify whether there are any invalidate chart data sequence inside, if so, catch the exception and remove it.
Comment 2 Chen Peng 2012-06-08 06:47:44 UTC
Created attachment 78185 [details]
patch for bug 119912 Crash when redo split the pasted table
Comment 3 Chen Peng 2012-06-08 07:01:56 UTC
I have test the patch by the steps, it works well.
Comment 4 Chen Peng 2012-06-08 09:50:28 UTC
Created attachment 78204 [details]
Repatch 19912
Comment 5 jsc 2012-06-08 10:11:24 UTC
reviewed, built, tested, no crash anymore, patch applied on trunk

trunk -> revision 1348006
Comment 6 binguo 2012-06-19 07:12:21 UTC
Verified it on Aoo_Trunk_20120616.1800.1350879 and it does not reproduce, no crash, so close it as fixed.
Comment 7 Shenfeng Liu 2012-10-09 09:39:55 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.