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 674954 - Conditional formatting should use managed dependents
Conditional formatting should use managed dependents
Status: RESOLVED DUPLICATE of bug 654495
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 13:09 UTC by Morten Welinder
Modified: 2013-02-06 02:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample file (1.92 KB, application/gnumeric)
2012-07-18 01:11 UTC, Morten Welinder
Details

Description Morten Welinder 2012-04-27 13:09:06 UTC
Right now we store 0-2 expressions in a GnmStyleCond.  We should store
them in managed deps so they respect insert/row insert/delete and other
similar operations.  This should also allow us to trigger recomputation
and thus redisplay.
Comment 1 Morten Welinder 2012-05-31 15:22:03 UTC
Storage fixed.  That leaves recomputation issues.
Comment 2 Morten Welinder 2012-07-18 01:11:56 UTC
Created attachment 219078 [details]
Sample file

This sample file has a conditional format on A3:A4 which sets a bold
font if the value is bigger than the value to the right of the cell.

We link this dependent incorrectly to B1 (presumably because that is
the cell to the right of A1).  When B1's cell changes, the "eval" on
the managed dependent triggers.  (That's currently a no-op.)
When B3:B4 changes, nothing happens.
Comment 3 Morten Welinder 2012-07-18 01:53:34 UTC
B1 does indeed come from A1 which, in turn, comes from eval_pos_init_dep
as called from dependent_link.  We have only one copy of the conditional
style, so clearly we cannot have two positions.

Tricky.  I don't know if we should keep this as one condition or split.

If we keep it as one, then we need to figure out dependents for each
cell the style is being used in.  I'm not sure how we would be told
when a new cell uses the existing style or when a cell ceases to use
the style.

If we split -- each cell with a conditional format gets its own copy
of the format -- then we can make eval_pos_init_dep know the position
somehow.  A new dependent type's eval notifier could clear the rendered
value.  Easy.  But this solution also requires us to know when a format
is being reused so we can split.  "How" is the question.  We would use
more memory, but since the common case of no-dependencies would not
need splitting, that is probably not important.

As a third alternative it might also be able to link B3 and B4 as
dependencies of A3 and A4.  We would get an unnecessary evaluation of
A3 and A4.  Also, the value-unchanged check in gnm_cell_eval_content
would have to be revisited.  (Or we would need a new special kind of
dependency that was tagged with affects-rendering-only.)
Comment 4 Morten Welinder 2013-02-06 02:28:03 UTC
Patch landed over in bug 654495.

*** This bug has been marked as a duplicate of bug 654495 ***