On Sat, 2002-01-19 at 18:04, Derek Atkins wrote:
> Hi,
> 
> In my work on the Entry Ledger, I've come across a problem.  I'm
> trying to write some code to determine _which_ cells changed.  In
> particular, I want to find out if a particular cell is the only cell
> that changed within a particular cursor.  Is there an easy way to do
> that?
> 
> I know that I could do this by running a loop over all my cells, by
> name, and testing whether the cell changed by calling:
> 
>         gnc_table_layout_get_cell_changed (ledger->table->layout, cell_name,
>                                         TRUE))
> 
> However, that seems like a lot more work, IMHO.  The cursor clearly
> knows whether there were any changes[0].
> 
> Question: since the cells are actually numbered in the Cursor[1],
> can't we provide a bitmask for all the cells that changed, and provide
> a function that gives the bit position of a cell in a cursor based on
> it's name?  Then I could see if the bitmask is all negative in all
> positions other than the one in question.

This exposes a lot of implementation detail just to answer a simple
question, I think.


> Another solution to my particular problem would be a function to
> return the number (count) of changed cells.  If the count != 1 then I
> know that something else was changed other than the cell in question.

This sounds much better. If we need something more general, returning
a list of changed cells would work, too.

dave

Attachment: msg01900/pgp00000.pgp
Description: PGP signature

Reply via email to