Re: [patch] Sleeping cells, correction

On Fri, Jul 12, 2002 at 11:35:25PM -0400, Jody Goldberg wrote:

hmm, an interesting idea.
Definitely not fodder for 1.0 though.

I thought it would be ;-)

minor style nit.
Avoid comparing to literal TRUE/FALSE.  It can fail depending on how
the flags are stored.

I'll look at the other code to see how it is done.

+                   return TRUE;
+           }
+   }
+   else if (cell->base.sheet->workbook->update_only_sleeping == TRUE) {
+           return TRUE;
+   }

+cell_is_sleeping(Cell const *cell)
+   return mstyle_get_content_sleeping(cell_get_mstyle(cell));

ouch this gets expensive.  The quad tree makes style lookups fast,
but still not something you want to do 1M times.

This check could be reversed so you would check if the workbook
is set to update_sleeping / update_only_sleeping first,
and only *then* do the cell_is_sleeping call.

This is still quite expensive for the common case though,
so maybe reverse-mapping it into the cells would not be a bad

The main question in my mind is why/how this would be useful.

The reason for this is simple; When a cell can execute
a shell command or do some other funky things like initiating
database connections, it becomes kindof nice if your heavy external
function call doesn't get executed every time gnumeric thinks it's
time to do a refresh.

The notion of a spreadsheet with _partially_ incorrect values is a
little scary.

Quite, actually. It breaks assumptions about the internal sheet state
that are likely to be liberally sprinkled throughout the code. One
thing I am sure gnumeric doesn't account for is non-sleeping cells
depending on sleeping cells and vice-versa. Frankly, to some
extend the user should be -careful- when using this. 

So no, I was pretty much not expecting this to go into stable.
I was asked to develop it against stable so that's what the
patch is based on, but it is definitely intended for development
purposes only.

However, putting it out there did seem worthwile so here it is.

Floris Kraak
We are all born mad.  Some remain so.
                -- Samuel Beckett

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]