Issue 119653

Summary: [From Symphony]Crash after delete column(s) from chart's source table, and then adjusted table size
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: ---
Description Flags
patch for bug 119653 chenpeng2006: review?

Description Yan Ji 2012-06-01 02:58:03 UTC
Build: AOO3.4
OS: All
1. New a document.
2. Insert a table then input some data.
3. Create a chart using the table as its data source.
4. Delete a column of table.
5. Drog to adjust columns width of table
Comment 1 Chen Peng 2012-06-01 06:11:47 UTC
Root Cause:
The crash happens because of an exception was thrown out in SwChartDataSequence::SetModified(), just because the SwCharDataSequence object has been disposed.
The source code is located in main/sw/source/core/unocore/unochart.cxx.
void SAL_CALL SwChartDataSequence::setModified(::sal_Bool bModified )
    throw (beans::PropertyVetoException, uno::RuntimeException)
    vos::OGuard aGuard( Application::GetSolarMutex() );
    if (bDisposed)
        throw lang::DisposedException();

    if (bModified)
		LaunchModifiedEvent( aModifyListeners, dynamic_cast< XModifyBroadcaster * >(this) );

Actually, the former design of SwClient will disband itself from the notification list in its destruction. But the SwCharDataSeqence won't be destructed but just disposed in code (the data member SwChartDataSequence::bDisposed will be set to TRUE), the relationship between client and modification are not released. So any notification from modify object will lead this crash.

Recorrect the logic of code in SwChartDataSequence::Dispose(), release the relationship inside..
Comment 2 Chen Peng 2012-06-01 06:32:09 UTC
Created attachment 77884 [details]
patch for bug 119653
Comment 3 jsc 2012-06-08 08:56:21 UTC
reviewed, built and tested, no crash anymore, patch applied to trunk

trunk -> revision 1347951
Comment 4 binguo 2012-06-19 07:00:14 UTC
Verified it on Aoo_Trunk_20120616.1800.1350879 and it does not reproduce, so close it as fixed.
Comment 5 Shenfeng Liu 2012-10-09 09:38:15 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.