How to retrieve the state of the feature "Format > AutoCorrect > While Typing" in Writer ?

Thibault Vataire <[email protected]> Mon, 28 Feb 2011 14:07:31 +0100 (CET)
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <1487537048.395.1298898451911.JavaMail.root@zimbra>
Hi,

I need to programmatically retrieve the state of the feature "Format > AutoCorrect > While Typing" in Writer.

I've tried two ways but none works properly :

1/ Reading the corresponding property in the Writer.xcu configuration file. But this value don't seem to be updated when application is running, only when the application is shutting down.

2/ I can read the state of the menu's entry :

myFrame.LayoutManager.getElement("private:resource/menubar/menubar").XMenuBar.getPopupMenu(itemId1).(...).isItemChecked(itemId2)

But this value is really updated only if the menu "AutoCorrect" is displayed one more time after the value has changed.

Is someone known another way to retrieve this value ?

Thanks,
Thibault
--