Apache OpenOffice (AOO) Bugzilla – Issue 71235
Writer having a cached value that doesn't react on changes of the configuration
Last modified: 2013-08-07 14:42:39 UTC
I change the value of the property "HiddenCharacter" of the nodpath "/org.openoffice.Office.Writer/Content/NonprintingCharacter" in the global OOo-configuration via api. Since writer documents use a internal caching of configuration options bound to the view, this changed value doesn't effect already opened writer documents, but after opening a new document, the changed value should be reflected by the "Tool->Options->Writer/ForrmattingAids/" dialog of the new document. But this is NOT done at the moment! Here is how to reproduce: 1) open a new writer document. 2) open the dialog "Tool->Options->Writer/ForrmattingAids/" and set ("check") the checkbox "HiddenCharacter" (I dont' know the exact label - translated from german), so that hidden characters will be shown in the document. 3) run the below macro (which simply unsets the former setting in the global configuration) 4) open a new writer document 5) open the dialog "Tool->Options->Writer/ForrmattingAids/HiddenCharacter" in the menubar of the NEW document. The checkbox is still "checked", so step 3) didn't has effect on new documents. that's all. If you dont't belive my macro is workung you could additionally do the following steps: 6) close all OOo-documents/windows/processes 7) open a new writer documents (check if OOos slashscreen was shown that indicates a successfull restart) 8) look at "Tool->Options->Writer/ForrmattingAids/HiddenCharacter". The checkbox is now UNchecked, so you can see that the below macro is working, but OOo simply doesn't recognize the changed configuration value during runtime. Here 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
changed the subject
jsc -> tl: can you please check this, it seems to be a missing listener or something like that. I would agree that at least when opening a document the changes should be noticed.
While we are at it: perhaps there are more missing listeners for Writer view settings
adjusting target
what about the options in "Tools->AutoCorrect..."? I currently tested the property ENABLED in the config-node /org.openoffice.Office.Writer/AutoFunction/Format/ByInput/ApplyNumbering and the changed value is not applied in a new created textdocument, too. Is this worth a separate issue?
.
The class SwContentViewConfig needs to call EnableNotification() in it's Ctor and has to overload ::Notify() to call Load(). BTW the other three ConfigItems in the same file need the same modifications.
Fixed in CWS tl37. Files changed: - sw/source/ui/config/usrpref.cxx - sw/source/ui/inc/usrpref.hxx
could you please set a target milestone?
Thomas, is this going to be integrated into a CWS planned for 2.3?
TL->MBA: Currently the CWS tl37 has no target assigned. If like to have OOo 2.3 as target I can change it accordingly.
Created attachment 45298 [details] Sample document with macro to demonstrate the fix
TL->MRU: you may either check this one yourself by using the macro in the attached document or pass this one to CN or SG. The checkbox mention in the text above is named "Hidden Text" in the English UI.
Reassigned to SBA.
SBA: Verified in CWS tl37.
SBA: OK in OOG680_m5 (OOo 2.3). Closed.