Bug 149189 - Update chart with method update() does not work in Writer
Summary: Update chart with method update() does not work in Writer
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Armin Le Grand
URL:
Whiteboard: target:7.5.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Chart
  Show dependency treegraph
 
Reported: 2022-05-19 20:21 UTC by Regina Henschel
Modified: 2022-10-26 08:00 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Chart in text document (19.45 KB, application/vnd.oasis.opendocument.text)
2022-05-19 20:21 UTC, Regina Henschel
Details
Chart in spreadsheet (16.53 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-05-19 20:22 UTC, Regina Henschel
Details
Update() with explicit ExtendedControlOverEmbeddedObject (19.45 KB, application/vnd.oasis.opendocument.text)
2022-05-19 20:43 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2022-05-19 20:21:28 UTC
Created attachment 180235 [details]
Chart in text document

I have a text document and a spreadsheet each with a chart based on a table. Both documents contain a very similar macro, which deletes a column in the chart. To update the object in the hosting document to the change, the macro uses the method 'update()'. That works for the chart in Calc, but not for the chart in Writer. If you double-click the chart in Writer or save and reload the document you can see, that the macro has indeed changed the chart, only the object was not updated. The same method 'update()' works for a Math-object in Writer. Therefore I consider it a bug, that the method does not work for a Chart.

To see the problem do this:
Open the attached document and allow execution of macros.
Select the chart, but do not go to edit mode.
Press Alt+F11, select the macro which is contained in the document, and run it.
Comment 1 Regina Henschel 2022-05-19 20:22:18 UTC
Created attachment 180236 [details]
Chart in spreadsheet
Comment 2 Regina Henschel 2022-05-19 20:43:49 UTC
Created attachment 180237 [details]
Update() with explicit ExtendedControlOverEmbeddedObject

OpenOffice.org needs the explicit version with ExtendedControlOverEmbeddedObject and window refresh is not complete (scroll up and down). But besides that, the method update() works in Writer in OOo.
Comment 3 Regina Henschel 2022-05-19 21:10:19 UTC
It fails in Version: 5.4.7.2 (x64)
Build ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU threads: 8; OS: Windows 6.19; UI render: default; 
Locale: de-DE (en_US); Calc: CL

The method update() works in Version: 5.2.6.2
Build ID: a3100ed2409ebf1c212f5048fbe377c281438fdc
CPU Threads: 8; OS Version: Windows 6.2; UI Render: default; 
Locale: de-DE (en_US); Calc: group
Comment 4 Andreas Heinisch 2022-06-24 11:59:56 UTC
I tried to bisect the issue, but I have no idea if I hit the right commit: 61cb66513bfdaa5e47fb419d476107b40e62e7d0 is the first bad commit
commit 61cb66513bfdaa5e47fb419d476107b40e62e7d0
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Sat Jul 9 12:38:32 2016 -0700

    source 64e1113916a6b19b30f95b454018528571ac84df

    source 64e1113916a6b19b30f95b454018528571ac84df

 instdir/program/mswordlo.dll   | Bin 2338816 -> 2338816 bytes
 instdir/program/swlo.dll       | Bin 13363200 -> 13364736 bytes
 instdir/program/swuilo.dll     | Bin 2340864 -> 2340864 bytes
 instdir/program/vbaswobjlo.dll | Bin 1238528 -> 1238528 bytes
 instdir/program/version.ini    |   2 +-
 5 files changed, 1 insertion(+), 1 deletion(-)
Comment 5 Andreas Heinisch 2022-06-24 12:02:23 UTC Comment hidden (bibisection)
Comment 6 raal 2022-06-24 17:24:31 UTC
(In reply to Andreas Heinisch from comment #4)
> I tried to bisect the issue, but I have no idea if I hit the right commit:
> 61cb66513bfdaa5e47fb419d476107b40e62e7d0 is the first bad commit
> commit 61cb66513bfdaa5e47fb419d476107b40e62e7d0
> Author: Norbert Thiebaud <nthiebaud@gmail.com>
> Date:   Sat Jul 9 12:38:32 2016 -0700
> 
>     source 64e1113916a6b19b30f95b454018528571ac84df
> 
>     source 64e1113916a6b19b30f95b454018528571ac84df
> 
>  instdir/program/mswordlo.dll   | Bin 2338816 -> 2338816 bytes
>  instdir/program/swlo.dll       | Bin 13363200 -> 13364736 bytes
>  instdir/program/swuilo.dll     | Bin 2340864 -> 2340864 bytes
>  instdir/program/vbaswobjlo.dll | Bin 1238528 -> 1238528 bytes
>  instdir/program/version.ini    |   2 +-
>  5 files changed, 1 insertion(+), 1 deletion(-)

Looks relevant: https://git.libreoffice.org/core/+/64e1113916a6b19b30f95b454018528571ac84df

You can check it with following:
git checkout 61cb66513bfdaa5e47fb419d476107b40e62e7d0  -> bug should be here
git checkout HEAD~1 -> bug should not be here (move one commit before 61cb66513bfdaa5e47fb419d476107b40e62e7d0)
Comment 7 Andreas Heinisch 2022-06-29 07:36:08 UTC
Adding Cc: to Armin Le Grand

May you take a look at this one? Thank you very much!
Comment 8 Armin Le Grand 2022-10-24 16:09:39 UTC
After digging quite some time & comparing why SC works, I found that while SC uses
  EmbedEventListener_Impl
which has a XModifyListener component and a ::modified(...) call, the class used for this in SW which is
  SwOLEListener_Impl
does not have that. Digging deeper how that can be extended to make SW react and then - if possible - reach out to the buffered Chart data in SW which would need a call/acess to
  SwOLEObj::resetBufferedData
Let's hope the best...
Comment 9 Armin Le Grand 2022-10-25 09:10:59 UTC
Got that connected, but somehow also EmbedEventListener_Impl::modified is called when the writer example is triggered - have to check if this is due to my changes or was so before, too
Comment 10 Armin Le Grand 2022-10-25 09:53:09 UTC
Possible solution on gerrit1:
https://gerrit.libreoffice.org/c/core/+/141803
Comment 11 Commit Notification 2022-10-25 12:27:22 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ac0e74209c4f7a7eb7702468cecd3b996227c278

tdf#149189 detect and handle graphic change on Sw OLE

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.