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

List:       koffice-devel
Subject:    Re: Crash in KSpread - ERROR: Circle
From:       Norbert Andres <nandres () web ! de>
Date:       2002-08-19 17:13:08
[Download RAW message or body]

On Monday 19 August 2002 07:01, Philipp Müller 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 
crashes. After removing this calc() they were gone.

I would like to check in the following:

First change: 
	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 => 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
===================================================================
RCS file: /home/kde/koffice/kspread/kspread_cell.cc,v
retrieving revision 1.434
diff -u -r1.434 kspread_cell.cc
--- 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 = d->Table()->cellAt( c, r );
             cell->clearAllErrors();
+            cell->setFlag(Flag_CalcDirty);
             cell->calc();
         }
       }
@@ -1826,7 +1827,7 @@
     if ( painter.device()->isExtDev() || !drawCursor)
       selected = false;
   }
-  calc();
+  //  calc();

   // Need to make a new layout ?
   if ( testFlag(Flag_LayoutDirty) )
@@ -4072,7 +4073,7 @@
         // are position independent.
         if ( isFormula() )
         {
-            calc();
+          //            calc();
             QDomElement text = 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
[prev in list] [next in list] [prev in thread] [next in thread] 

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