Bug 126499 - Chart in a form: setmodified(true) won't be executed
Summary: Chart in a form: setmodified(true) won't be executed
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-07-22 05:50 UTC by Robert Großkopf
Modified: 2022-06-03 16:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Try to change values for "Temperatur" in the form "Temperaturverlauf". Chart won't be modified any more. (deleted)
2019-07-22 05:50 UTC, Robert Großkopf
Details
New - Try to change values for "Temperatur" ind form "Temperaturverlauf". Chart won't be modified. (65.60 KB, application/vnd.oasis.opendocument.database)
2019-07-23 07:45 UTC, Robert Großkopf
Details
Modified version using doVerb() (65.50 KB, application/vnd.oasis.opendocument.database)
2020-02-26 04:48 UTC, Stang
Details
LO version 7.1.0.3 details (18.49 KB, image/png)
2021-02-03 19:26 UTC, Stang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2019-07-22 05:50:22 UTC
Created attachment 152896 [details]
Try to change values for "Temperatur" in the form "Temperaturverlauf". Chart won't be modified any more.

Open the attached database, macros must be allowed.
Open the form "Temperaturverlauf".
Change the "Temperatur" for "Zeit"=00:00:25.
Nothing will change in the chart.
Chart will only show the values, which have been saved since creating of the form.

The macro, which should change the values for the chart, runs well up to LO 5.2.7.2, fails first with LO 5.3.0.3 on OpenSUSE 15, 64bit rpm Linux.

Seems only "setmodified(true)" doesn't work any more. The values were written to the chart - have controlled this with xray ...
Comment 1 Oliver Brinzing 2019-07-22 15:56:46 UTC Comment hidden (obsolete)
Comment 2 Robert Großkopf 2019-07-22 19:15:42 UTC
(In reply to Oliver Brinzing from comment #1)
> attached file seems to be damaged:

Seems there is the same error-message bugzilla gave today (22.7.) when searching for content in bugzilla. The downloaded file is 715 byte, the attachment has 65.60 KB.
Comment 3 Robert Großkopf 2019-07-23 07:45:00 UTC
Created attachment 152949 [details]
New - Try to change values for "Temperatur" ind form "Temperaturverlauf". Chart won't be modified.
Comment 4 Oliver Brinzing 2019-07-24 17:19:08 UTC
i can confirm with LO 6.1.3/LO 5.4.7.2:

- macro ChangeData() is called onLoad "Temperaturverlauf".

- macro is called after changinag a value,
- and chart model data is updated with new values
- but chart does not refresh

but it works with LO 4.4.7.2
Comment 5 Xisco Faulí 2019-08-01 15:49:33 UTC
it needs to be bisected with 5.3.
Regression introduced somewhere in https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=50a0473e821081c1db2646dd4c3fcc24f5c11bf3..dcae0b482ca78fc9cd6f8523f53aad8c8b486b0f
Comment 6 Xisco Faulí 2019-08-01 15:52:18 UTC
Also reproduced on win
Comment 7 Stang 2020-02-26 04:47:25 UTC
Have an alternative using doVerb().

In ActivateDiagram replaced:

    oXCOEO.changeState(4)	' UI_ACTIVE = 4
    oXCOEO.changeState(0)	' LOADED = 0

with:

    oXCOEO.doVerb(-2)
    oXCOEO.doVerb(-3)

Then added:

    oXCOEO = oDiag.ExtendedControlOverEmbeddedObject
    oXCOEO.doVerb(-2)
    oXCOEO.doVerb(-3)

to the end of Change Data.

Works well on Ubuntu 18.04 Mate with LO:

Version: 6.4.0.3
Build ID: b0a288ab3d2d4774cb44b62f04d5d28733ac6df8
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Will attach original sample with noted modifications.
Comment 8 Stang 2020-02-26 04:48:40 UTC
Created attachment 158193 [details]
Modified version using doVerb()
Comment 9 Buovjaga 2020-06-08 18:41:38 UTC
Robert: is this WFM, too, like bug 122298?
Comment 10 Robert Großkopf 2020-06-08 19:41:16 UTC
(In reply to Buovjaga from comment #9)
> Robert: is this WFM, too, like bug 122298?

Yes, its the same I solved in
https://bugs.documentfoundation.org/attachment.cgi?id=161675

There were mistakes in the changeState, like described in comment 7

I will set this one as worksforme
Comment 11 Stang 2021-02-03 19:23:34 UTC
Samples posted here and in bug 122298 no longer work in LO v7.1.0.3
Comment 12 Stang 2021-02-03 19:26:27 UTC
Created attachment 169455 [details]
LO version 7.1.0.3 details

LO version detail
Comment 13 Buovjaga 2021-02-04 06:41:17 UTC
That's a new regression. I will bibisect it today and create a new report based on attachment 161675 [details].
Comment 14 Mike Kaganski 2021-04-26 15:12:13 UTC
(In reply to Stang from comment #11)
> Samples posted here and in bug 122298 no longer work in LO v7.1.0.3

(In reply to Buovjaga from comment #13)
> That's a new regression. I will bibisect it today and create a new report
> based on attachment 161675 [details].

Note that since fixing tdf#77007, you can't sett a chart modified in a document that disallows setting modified. This looks correct to me, and thus the macro in attachment 161675 [details] will not work: the said macro attempts to update the chart using a call to css::util::XModifiable::setModified, relying on a side effect of that call; while the proper way would be calling css::util::XUpdatable::update.
Comment 15 Robert Großkopf 2021-04-26 16:56:16 UTC
Has changed a little bit more with LO 7.1, but this will work:

oDiag.model.DataProvider.setData(aNewData)
oDiag.model.DataProvider.setRowDescriptions(aNewRowDescription)
oDiag.model.DataProvider.setColumnDescriptions(aNewColumnDescription)
oDiag.Component.setmodified(true)	
oDiag.Component.update()
oXCOEO.changeState(1)

Don't know why, but there has to been added the update() command to change the charts.