[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: KDChart crash
From:       Dag Andersen <danders () get2net ! dk>
Date:       2010-06-22 9:38:08
Message-ID: 201006221138.08319.danders () get2net ! dk
[Download RAW message or body]

Tirsdag 22 juni 2010 10:07:48 skrev Dag Andersen:
> If a cooridateplane that is refrenced by another coordinatepalne is removed
> from the chart, I get the following assert:
> ASSERT: "planeLayout" in file
> /opt.kde/src/kdesvn/koffice/plugins/chartshape/kdchart/src/KDChartChart.cpp
> , line 509
> 
> So atm the user app is required to setReferenceCoordinatePlane( 0 ) before
>  the referenced plane is removed.
> The patch makes it safe to remove a plane that references another plane.
This patch wasn't enough, new patch follows. The plane that *is* removed also 
needs to have 0 refrence plane. (Haven't figuered out why)
-- 
Mvh.
Dag Andersen

["crash.diff" (text/x-patch)]

Index: KDChartChart.cpp
===================================================================
--- KDChartChart.cpp	(revision 1140071)
+++ KDChartChart.cpp	(working copy)
@@ -91,6 +91,7 @@
 
 void Chart::Private::slotUnregisterDestroyedPlane( AbstractCoordinatePlane* plane )
 {
+    plane->setReferenceCoordinatePlane(0);
     coordinatePlanes.removeAll( plane );
     Q_FOREACH ( AbstractCoordinatePlane* p, coordinatePlanes )
     {
@@ -961,13 +962,10 @@
 {
     const int idx = d->coordinatePlanes.indexOf( plane );
     if( idx != -1 ){
-        d->coordinatePlanes.takeAt( idx );
         disconnect( plane, SIGNAL( destroyedCoordinatePlane( AbstractCoordinatePlane* ) ),
                     d, SLOT( slotUnregisterDestroyedPlane( AbstractCoordinatePlane* ) ) );
-        plane->removeFromParentLayout();
-        plane->setParent( 0 );
+        d->slotUnregisterDestroyedPlane( plane );
     }
-    d->slotLayoutPlanes();
     // Need to emit the signal: In case somebody has connected the signal
     // to her own slot for e.g. calling update() on a widget containing the chart.
     emit propertiesChanged();


_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic