Christoph Lutz wrote:
> Hi, I would like to change a value of
> "Tool->Options->Writer/ForrmattingAids/(show)Hidden Characters" in a
> programmatic way. This is done by the macro (below), but after running
> the code, the Tools->Options Dialog doesn't reflect the change. Only
> after closing all office-processes and restarting the writer process,
> the changed value could be seen in the dialog (so the macro is
> working, but the changes don't have effect during runtime).
>
> Here is the code:
>
> Sub setConfigOption
> dim args(1) as new com.sun.star.beans.PropertyValue
> args(0).name = "nodepath"
> args(0).value =
> "/org.openoffice.Office.Writer/Content/NonprintingCharacter"
>
> prov =
> createUnoService("com.sun.star.configuration.ConfigurationProvider")
> update =
> prov.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",
> args)
>
> update.HiddenCharacter = false
> update.commitChanges()
>
> update.dispose()
> End Sub
>
> So I Assume that there is jus some kind of refresh missing. Could you
> give me a hint, which component has to be refreshed or what I can do
> that my macro has effect during runtime?
Are you sure that it doesn't affect even new documents you create later?
Then it would be a bug (Writer having a cached value that doesn't react
on changes of the configuration) and you should create an issue.
If it only doesn't affect the current (or other already opened)
documents the reason is that this is a document setting that is read
from the configuration and set when the document is created. This
happens with quite a lot of view settings in Writer. If you switch it on
in the GUI it will be applied to both the configuration (that's what you
did in your macro) *and* the view settings of the current document
I don't know the API to change the corresponding setting at the
document, sorry. Perhaps somebody else does.
Ciao,
Mathias
--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]