Question about Tables, Cursors, and Cells

Dave Peticolas dave@krondo.com
20 Jan 2002 03:25:32 -0800


--=-N+2lIpkBZFyXFuEj+38H
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sat, 2002-01-19 at 18:04, Derek Atkins wrote:
> Hi,
>=20
> 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?
>=20
> 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:
>=20
>         gnc_table_layout_get_cell_changed (ledger->table->layout, cell_na=
me,
> 					  TRUE))
>=20
> However, that seems like a lot more work, IMHO.  The cursor clearly
> knows whether there were any changes[0].
>=20
> 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 !=3D 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


--=-N+2lIpkBZFyXFuEj+38H
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA8Sqkr5effKKCmfpIRApiRAKDWEhpiXbywcFBEsq9jkqSoV58DogCfYPdt
/PuFgV17r4922hEsKB+S940=
=tcho
-----END PGP SIGNATURE-----

--=-N+2lIpkBZFyXFuEj+38H--