Issue 103101 - wrong view update after changing CharHidden via API
Summary: wrong view update after changing CharHidden via API
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 3.1
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-25 14:57 UTC by clutz
Modified: 2017-05-20 11:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
A testcase for the update-view bug. Open it, and press the button. The lines one and tree vanish. (23.16 KB, application/vnd.oasis.opendocument.text)
2009-06-25 15:01 UTC, clutz
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description clutz 2009-06-25 14:57:21 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.
Comment 1 clutz 2009-06-25 15:01:09 UTC
Created attachment 63212 [details]
A testcase for the update-view bug. Open it, and press the button. The lines one and tree vanish.
Comment 2 eric.savary 2009-06-25 15:14:16 UTC
Reassigned to JSK
Comment 3 michael.ruess 2009-06-25 15:21:49 UTC
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.
Comment 4 clutz 2009-06-26 10:12:47 UTC
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
Comment 5 Marcus 2017-05-20 11:17:42 UTC
Reset assigne to the default "issues@openoffice.apache.org".