Apache OpenOffice (AOO) Bugzilla – Issue 103101
wrong view update after changing CharHidden via API
Last modified: 2017-05-20 11:17:42 UTC
This issue might be related to issue #78896 but the symptoms and the usecase slightly differ, so I post a new issue for this one. The attached letterhead has some text content which gets hidden and viewed again due to a necessary workflow of our letterhead system. The following included macro-code simulates these steps: Sub Main t = ThisComponent.Text cursor = t.createTextCursorByRange(t) cursor.setPropertyValue("CharHidden", true) cursor.setPropertyToDefault("CharHidden") End Sub After running the macro, there are some lines still invisible though the API-representation of the objects has set CharHidden=false. It seems that the view is not updated correctly after changing the property value. Here is how to reproduce: 1) open the attached document updateBug2.odt and allow the macro to be executed. 2) look at the document - there are the lines one, two, three and four 3) press the button which calls the above macro code 4) look at the document - there are only the lines two and four left. 5) Do this just to prove that the internal representation of the objects is correct: save the document and press file->reload 6) look at the document - the origin content with all four lines is restored.
Created attachment 63212 [details] A testcase for the update-view bug. Open it, and press the button. The lines one and tree vanish.
Reassigned to JSK
MRU->OS: when the "non-printing characters" are turned off, the view will be incorrectly updated when executing the macro in the sample. When the "non-printing characters" are turned on, you can see that the hidden-attribute is applied correctly to the text.
Here is one possible workaround for the update problem: Sub Main t = ThisComponent.Text cursor = t.createTextCursorByRange(t) cursor.setPropertyValue("CharHidden", true) ' setting the text visible before restoring the default value forces a correct update cursor.setPropertyValue("CharHidden", false) cursor.setPropertyToDefault("CharHidden") End Sub
Reset assigne to the default "issues@openoffice.apache.org".