Issue 101273

Summary: Bad graph refreshing when pressing [F9]
Product: General Reporter: diaz_frederic <diaz_frederic>
Component: chartAssignee: oc
Status: CLOSED FIXED QA Contact: issues@graphics <issues>
Severity: Trivial    
Priority: P3 CC: IngridvdM, issues, jbf.faure, kyoshida, niklas.nebel
Version: 3.3.0 or older (OOo)Keywords: regression
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 101565    
Attachments:
Description Flags
In this .ods file it's possible to test the chart refeshing problem
none
propsed patch
none
bugdoc with chart of random data which crashes OOo 3.1.0 when pressing F9 none

Description diaz_frederic 2009-04-22 13:47:49 UTC
When pressing [F9], datas of Calc Sheet are refreshed but not the corresponding
chart. I add that this wrong behavior didn't exist in previous versions.
Comment 1 diaz_frederic 2009-04-22 13:52:37 UTC
Created attachment 61728 [details]
In this .ods file it's possible to test the chart refeshing problem
Comment 2 jbf.faure 2009-04-22 18:29:20 UTC
I confirm the problem under Ubuntu 8.04 for OOo 3.1 RC1 : if you open the bugdoc
with OOo 3.0.1 and press F9, data are modified and the chart is updated. 
With OOo 3.1 RC1 the chart is not updated.

Regards
JBF
Comment 3 IngridvdM 2009-04-23 12:41:47 UTC
@kohei, this regression was introduced by CWS koheiformula02. Please have a look.
Comment 4 kyoshida 2009-04-23 14:36:15 UTC
Heh, interesting.

Quite timely, I was just working on stuff that involves F9 update.  Let's see
what I'll find there.
Comment 5 kyoshida 2009-04-23 18:10:14 UTC
Ok.  The reason the chart was not being updated was because the data cache was
not being rebuilt on F9 update.

The reason the data cache was not rebuilt was because the cache was not emptied
before BuildDataCache() was called (the method was being called as it should be).

And, the reason why the cache was not emptied was because, when you hit F9, the
values of the cells get updated on screen but ScChart2DataSequence::Notify() was
not called to notify the data change within the data source range.

Now, I'm trying to figure out why it's not notifying ScChart2DataSequence of
data change like it should....
Comment 6 kyoshida 2009-04-23 18:28:03 UTC
Ah, an F9 update is not considered to be modifying the document?  No wonder the
chart object is not notified of the value change.
Comment 7 kyoshida 2009-04-23 18:33:49 UTC
Ok.  I've found a reasonable way to fix this.  I'll attach a proposed patch shortly.
Comment 8 kyoshida 2009-04-23 18:50:09 UTC
Created attachment 61761 [details]
propsed patch
Comment 9 kyoshida 2009-04-23 18:53:30 UTC
The fix is to broadcast value change to UNO objects (which all chart objects
are) when Calc does F9 re-calculation.  BTW, I've also added one brace set where
the braces were missing.  I'm not sure if it was me who did that, or just an
integration hiccup, but either way those braces in chart2uno.cxx should be there.

@iha: is there an open CWS where you can commit this patch to?
Comment 10 kyoshida 2009-04-24 16:57:36 UTC
@iha: if there is no open cws for this, then I can commit this to koheiformula03
for 3.2 integration.  Let me know.
Comment 11 jbf.faure 2009-04-24 18:40:47 UTC
Is it possible to fixe this bug in OOo 3.1 ? As it is a regression we could
consider this issue as stopper. An unfixed regression is always a bad user
experience.

Kind regards
JBF
Comment 12 niklas.nebel 2009-04-24 19:23:57 UTC
Kohei, DoHardRecalc (shift-ctrl-f9) must also be handled. I can take care of
this next week.
Comment 13 kyoshida 2009-04-24 19:28:08 UTC
@nn: ah, ok.  So, the hard recalc is still being used, huh?  Good to know.  I
was wondering about that.

Thanks for taking care of this, Niklas.
Comment 14 niklas.nebel 2009-04-24 19:31:35 UTC
jbfaure, there is an easy workaround (modify the document: instead of F9 press
backspace on an empty cell), and charts from random data are not very common.
Comment 15 jbf.faure 2009-04-24 21:01:12 UTC
@ nn : yes I know that, but such kind of document is designed for education
purpose and needs to be modified if one want used it with OOo 3.1. Basic users
are not aware of this kind of subtilities.
Comment 16 niklas.nebel 2009-04-27 11:00:10 UTC
taking the issue
Comment 17 niklas.nebel 2009-04-27 11:02:57 UTC
It's fixed in CWS "calclinkfixes" (it was broken with a fix for links, so it
kind of fits there).
Comment 18 niklas.nebel 2009-04-27 11:48:38 UTC
reassigning to QA for verification
Comment 19 jbf.faure 2009-05-17 21:43:25 UTC
I'll attach a new bugdoc which crashes my OOo 3.1.0 on ubuntu 8.04 when I press
F9. This doc is similar to the first one : chart with random data. Pressing
ctrl+maj+F9 replays random function but does not refresh the chart.
Does the patch work with this file ?

Regards
JBF
Comment 20 jbf.faure 2009-05-17 21:45:00 UTC
Created attachment 62333 [details]
bugdoc with chart of random data which crashes OOo 3.1.0 when pressing F9
Comment 21 kyoshida 2009-05-18 00:33:47 UTC
It works for me though.  No crash here (on openSUSE).  Do you have a stack trace
on your crash?

Not working with shift-ctrl-F9 is known; I didn't bother to fix that one because
I thought it was going to be fixed in the upstream build for 3.1, which, as I
just checked, is not the case unfortunately.  But fixing that is super-trivial.
Comment 22 jbf.faure 2009-05-18 07:41:26 UTC
I don't have crash report. I refused to send it for the first crash and now OOo
does not propose anymore to send a crash report.
I found that the crash has something to do with Language Tool extension. If I
remove it there is no crash.

Regards
JBF
Comment 23 niklas.nebel 2009-05-19 15:35:12 UTC
taking the issue back for fixing in 3.1.1
Comment 24 niklas.nebel 2009-05-19 16:42:28 UTC
Also fixed in CWS "calc311fixes", for 3.1.1.
Comment 25 niklas.nebel 2009-05-26 18:56:50 UTC
reassigning to QA for verification
Comment 26 oc 2009-05-28 08:46:10 UTC
verified in internal build cws_calc311fixes (OOo311) and 
verified in internal build cws_calclinkfixes (OOo32)
Comment 27 amy2008 2009-06-15 09:32:31 UTC
Verified in OOo3.1.1(OOo310m13) on WinXP 
Closing
Comment 28 IngridvdM 2009-07-02 17:09:04 UTC
*** Issue 103241 has been marked as a duplicate of this issue. ***