After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674914 - Validation should use managed dependents
Validation should use managed dependents
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2012-04-27 00:48 UTC by Morten Welinder
Modified: 2012-05-10 19:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2012-04-27 00:48:57 UTC
Right now we store 0-2 expressions in a validation.  We should store
them in managed deps so they respect insert/row insert/delete and other
similar operations.
Comment 1 Andreas J. Guelzow 2012-04-27 01:11:23 UTC
This is true for conditional formatting too. At least at the moment we don't respect insert/row insert/delete.
Comment 2 Morten Welinder 2012-04-27 13:09:33 UTC
Right, but the issues are slightly different, so that is now bug 674954.
Comment 3 Morten Welinder 2012-05-02 15:01:33 UTC
Just using a GnmDependent is not enough:

GnmValidation is used in GnmStyle.  It is part of the hash[1], so if we
were to magically change the expression, we would change the hash value.
That would corrupt hash tables.

In practice that means  sheet->style_data->style_hash.  We will have to
remove the style from there before changing it and re-insert it afterwards.
And deal with the possibility that it clashes with another entry after the
change.

Undo will then not be a simple matter of restoring the expression in the
dependent.

Is it even correct to change all cells with the same validation to the same
thing in response to col/row insert/delete?  Luckily we can assume that
styles are not shared across sheets.  That still leaves issues with relative
addressing.

In short, it's a bit of a mess.



[1] Well, the pointer value of the GnmValidation is part of the hash,
    but since nothing keeps validations unique by pointer that is a
    bug in and of itself.
Comment 4 Morten Welinder 2012-05-04 01:32:26 UTC
Note, that the hash parts of this are easy to fix: just don't have the
validation be part of the hash.  There, done.  But that does nothing
for the harder issue of style collision after the change.
Comment 5 Morten Welinder 2012-05-10 19:59:56 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.