Issue 119912

Summary: [From Symphony]Crash when redo split the pasted table
Product: Writer Reporter: Yan Ji <yanji.yj>
Component: editingAssignee: AOO issues mailing list <issues>
Status: CLOSED FIXED QA Contact:
Severity: Critical    
Priority: P3 CC: binbjguo, chenpeng2006, jsc, liushenf
Version: 3.4.0   
Target Milestone: 4.0.0   
Hardware: PC   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
patch for bug 119912 Crash when redo split the pasted table
none
Repatch 19912 chenpeng2006: review? (jsc)

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.