From koffice-devel Mon Aug 19 17:13:08 2002 From: Norbert Andres Date: Mon, 19 Aug 2002 17:13:08 +0000 To: koffice-devel Subject: Re: Crash in KSpread - ERROR: Circle X-MARC-Message: https://marc.info/?l=koffice-devel&m=102977712507352 On Monday 19 August 2002 07:01, Philipp M=FCller wrote: > Am Sonntag, 18. August 2002 17:11 schrieb Norbert Andres: > > I really don't know, where they come from: it seems like some > > dependancies are missing or ...??? > > It's really hard to track and I'm not sure if this is the real fix for > nonvalid cell pointers in the iterator. > > But from testing, Laurent and I have seen, that the routine with the > iterator from m_ObscuringCells was called twice. On the second call, it > brought the nonvalid cell reference. > In theory, the cell->calc() can leed to this, as within calc() you get a > cell->paintCell in some cases, so it can leed to such problems. Not only in theory - I think these are the cases when I experienced the=20 crashes. After removing this calc() they were gone. I would like to check in the following: =46irst change:=20 if we have changed our value, the cells that depend on us need to be recalculated -> that's why I set the flag. 2nd change: one of the reason for bugs =3D> see discussion thread 3rd change: if we don't need to recalculate when painting we don't need to do this for saving either. Ok? This should increase performance when saving at least a little bit. A change I'd like to have: we also recalculate on right mouse button click in a cell containing a formula. I think this is because of the Thesaurus feature. Anyway, I don't think we need it, but I haven't found the place where we do this yet. Index: kspread_cell.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/koffice/kspread/kspread_cell.cc,v retrieving revision 1.434 diff -u -r1.434 kspread_cell.cc =2D-- kspread_cell.cc 2002/08/18 09:01:55 1.434 +++ kspread_cell.cc 2002/08/19 17:01:10 @@ -1758,6 +1758,7 @@ { cell =3D d->Table()->cellAt( c, r ); cell->clearAllErrors(); + cell->setFlag(Flag_CalcDirty); cell->calc(); } } @@ -1826,7 +1827,7 @@ if ( painter.device()->isExtDev() || !drawCursor) selected =3D false; } =2D calc(); + // calc(); // Need to make a new layout ? if ( testFlag(Flag_LayoutDirty) ) @@ -4072,7 +4073,7 @@ // are position independent. if ( isFormula() ) { =2D calc(); + // calc(); QDomElement text =3D doc.createElement( "text" ); text.appendChild( doc.createTextNode( encodeFormula() ) ); cell.appendChild( text ); _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel