Setting control label at runtime changes the document status?

https://ask.libreoffice.org/uploads/short-url/juTp24fvbcTPD42OhmPNiVXEkI3.odt
I produced this demo for another topic. The form button on a Writer document performs some action, changes the label and performs another action on next click.
The code distinguishes between the runtime control oButton and its model oModel, reads the current label string from the model and then calls oButton.setLabel(s). To my surprise, the document status becomes modified, so I have to do this:

	oButton = ev.Source
	oModel = oButton.getModel()
[...]
	ThisComponent.disableSetModified()
		oButton.setLabel(s)
	ThisComponent.enableSetModified()

IMHO, this should not be necessary, because I don’t change anything that needs to be stored. As far as I understand the matter, only the model properties are stored.

Hello Andreas!
Changing the Label property of oButton control causes change the Label property of its model.
At the beginning of similar macros, I save the state of the document (isModified), and at the end I restore (setModified) if it has changed

Thank you for clearing a misconception of mine.

1 Like