Bug 153235 - Layout is broken after a macro until update/save-and-reload
Summary: Layout is broken after a macro until update/save-and-reload
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.6.0 target:7.5.1
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-27 08:25 UTC by Mike Kaganski
Modified: 2023-02-01 12:12 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
A document with an as-character OLE, to-paragraph image, and a macro to set objects' properties (117.23 KB, application/vnd.oasis.opendocument.text)
2023-01-27 08:25 UTC, Mike Kaganski
Details
A smaller sample (26.11 KB, application/vnd.oasis.opendocument.text)
2023-01-27 10:42 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2023-01-27 08:25:16 UTC
Created attachment 184955 [details]
A document with an as-character OLE, to-paragraph image, and a macro to set objects' properties

Open the attached document, and run SetDefaultStyle macro.
Often (but not 100%), immediately after the macro, the image is located above the OLE object, and the latter is partly visible at the bottom of the first page (there's no second page). In this case, saving and reloading, or using Tools->Update->Update All, fixes the layout: the OLE object gets above the image, and the latter goes to the second page, as expected.

The problem seems to only appear when the macro is run using Tools->Macros->Run Macro; and additionally, when the dialog overlaps the document window. It does not appear when the macro is run from IDE; also it does not happen when the Macro Selector dialog is moved elsewhere, so that the mouse is not inside the document window after clicking the [ Run ] button.

It looks related to *some* processing of application events inside SbiRuntime::Step.
Comment 1 Commit Notification 2023-01-27 08:27:56 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0b1d6220c6ece62653963ef782ee32efb639016e

tdf#153235: Optimize Application::Reschedule calls in SbiRuntime::Step

It will be available in 7.6.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.
Comment 2 Mike Kaganski 2023-01-27 10:42:59 UTC
Created attachment 184956 [details]
A smaller sample
Comment 3 Commit Notification 2023-02-01 12:12:43 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/358f21e0c2de2067c14c54ce41954954508d3550

tdf#153235: Optimize Application::Reschedule calls in SbiRuntime::Step

It will be available in 7.5.1.

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.