Consider this macro: sub test() doc = StarDesktop.loadComponentFromURL("private:factory/sdraw", "_default", 0, array()) page = doc.getDrawPages().getByIndex(0) doc.lockControllers() shape = doc.createInstance("com.sun.star.drawing.TextShape") page.add(shape) shape.setString("Some Text") point = new com.sun.star.awt.Point point.X = 2000 point.Y = 600 shape.setPosition(point) shape.setPropertyValue("CharWeight", 150) doc.unlockControllers() doc.storeAsURL(ConvertToURL("C:/Downloads/test.odg"), array()) end sub It creates a new Draw document; locks its controllers; creates and inserts a TextShape; sets its text, position, and weight; unlocks controllers and saves. (NB: change the path inside ConvertToURL to a path suitable for you when testing.) The created document is displayed immediately as saved and unchanged; and the text is shown bold, as expected. However, File->Reload changes the text to normal. Commenting out `doc.lockControllers()` and `doc.unlockControllers()` fixes the issue (but of course, that's not a solution: lockControllers helps improve performance, and should not create such a problem). The resulting document.xml has a paragraph autostyle (setting bold) used in <text:p> of the <draw:text-box>, unlike the case when controllers were locked (even though another paragraph autostyle, also with bold, is set in draw:text-style-name in <draw:frame>).
https://gerrit.libreoffice.org/c/core/+/198187
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3f87466d6db4ba694a8ba9f74dcac1b142a15f30 tdf#170386: Delay broadcasting object changes, not drop it It will be available in 26.8.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.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/f9b5f49113d69e194a8cfe58a18389b5852ce341 tdf#170386: Delay broadcasting object changes, not drop it It will be available in 26.2.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.