Re: recalculation



On Tue, Oct 30, 2001 at 09:05:02AM -0700, Andreas J. Guelzow wrote:
a short (and hopefully very simple) programming question...

if a tool changes the values of a range of cells, what is the prefered 
way to force recalculation?

Alot depends on how you are setting the new values in the range.
There are a spectrum of tools available, which are all fairly well
documented.

    - To set a single value
        sheet_cell_set_value / sheet_cell_set_text
    These are high level routines designed for changing SINGLE
    values.  They handle regenerating spans, and queueing recalcs.
    They do not actually DO the recalc, but they do queue all of the
    dependents of that cell for recalc.

    - To set a bunch of values
        cell_set_value / cell_set_text
    These are much lower level.  It stores the value but does not
    queue recalcs or regenerate spans.
        sheet_region_queue_recalc
    Can be used to queue everything in a region and its dependencies
    for recalc.
        sheet_range_calc_spans
    Will handle rendering and spanning

For both routines
        workbook_recalc
can be used to actually do the recalc after all the necessary bits
are dirtied.

Hope that helps



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