Bug 140155 - Macro not receiving event for form modification
Summary: Macro not receiving event for form modification
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: ModifiedStatus
  Show dependency treegraph
 
Reported: 2021-02-04 15:27 UTC by Buovjaga
Modified: 2021-04-26 13:44 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2021-02-04 15:27:32 UTC
1. Open attachment 161675 [details] from bug 122298 (enable macros when it asks)
2. Double click the form categories to open it
3. Change the first value in the amount column

The chart should update immediately. The display of the chart is also different, there are three bars per group and the legend is different.

Bibisected with linux-64-7.1 to
https://git.libreoffice.org/core/commit/574eec9036c5f185b3572ba1e0ca9d111eb361dc
tdf#77007: chart must honor its parent's IsEnableSetModified

Adding Cc: to Mike Kaganski

Reported by Stang in bug 126499

Also reproduced on Windows
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 62ee3d791d63cb693109b063b73dff5e81356d90
CPU threads: 2; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: fi-FI (fi_FI); UI: en-US
Calc: threaded
Comment 1 Mike Kaganski 2021-04-26 13:40:34 UTC
> Macro not receiving event for form modification

This title looks wrong. The event is received (and setting a breakpoint to SUB ChangeData would trigger the breakpoint when editing the data).

But I am inclined to call this NOTABUG. The macro calls 	oDiag.Component.setmodified(true), abusing its side effect of updating the component. Not setting its "modified" flag looks legitimate in a locked document with modifications disallowed; and instead, its XUpdatable::update() should be called:

> oDiag.Component.update()

which works as expected.

Trying to fix this could be either reverting the fix for tdf#77007 (and then trying to implement some more complex fix to make sure to mark loaded charts unmodified in different scenarios), or introducing some more complex logic to the check in the mentioned fix, which would try to guess if parent "IsEnableSetModified = false" does not apply to this element, which would be likely difficult to implement correctly.