Apache OpenOffice (AOO) Bugzilla – Issue 77637
hide/unhide of text sections is not reliable
Last modified: 2017-05-20 11:15:31 UTC
There's an example (created out of a real-word usecase) that shows that unhiding a text section that previously was hidden doesn't work reliable. With the help of a short macro it is possible to produce a text section with the property IsVisible=true, that is not visible in fact. I've got a textdocument that contains some text sections where all but one text sections should be invisible. The visible one represents a part of a text written in a specific language and our letterhead system controls the hiding/unhiding of the textsections depending on the language that is currently set in a variable of our letterhead system. After some cycles of hiding and unhiding the textsections, the problem occurs. The following macro simulate the cycles of hiding and unhiding the text sections: Sub showHideSections dim str as String str = "" sections = ThisComponent.getTextSections() for k=1 to 2 for i=0 to sections.getCount()-1 s = sections.getByIndex(i) s.IsVisible = true str = str & s.getName() & chr(10) s.IsVisible = false next i next k s.IsVisible = true msgbox str End Sub The macro iterates twice through all textsections in a document and switches their visibility states from IsVisible=true to IsVisible=false. The last textsection is set to be visible in the end, but the textsection is not shown in fact where it's property IsVisible=true. I will attach an example which could be used to reproduce the bug: 1) open the file showHideSectionsProblem.odt (YES to macros) 2) run the above macro (it's already included in the document as Standard.Module1.showHideSections) 3) you can see that the second table gets hidden as the respective textsection is hidden. But the last textsection called "Berenglisch GROUPS ('england')" should be visible in that place. 4) open the navigator (F5) and see that the textsection "Berenglisch GROUPS ('england')" is grey'ed to mark a invisible textsection. 5) in the navigator: call edit... on this textsection and see that the flag "hidden" is not set for the textsection "Berenglisch GROUPS ('england')". So this textsection should be visible.
Created attachment 45281 [details] An example that shows that hiding/unhiding of textsections is not reliable
Sorry, the last section that should be visible is called "Berdeutschland GROUPS ('deutschland')". Please use this instead of "Berenglisch GROUPS ('england')" btw. I was able to reproduce the bug on OOo2.2 (linux), OOo 2.0.4 (linux) and OOo 2.2 (windows)
It seems that one cause for the bug is the fact that the sections adjoin. If I put at least one paragraph between the sections, the hide/unhide scenario works. This is of cause only a bad workaround since I need an empty paragraph between the sections and the paragraph will not be hidden (ugly spaces). But maybe this helps finding the cause.
@mru: could you please assign this issue to someone who feels responsible?
MRU->OS: see attached document. After the macro has run, ALL sections in the document are hidden, though the Format.Section dialog states, that "Berdeutschland GROUPS ('deutschland')" is not hidden at all. Please have a look.
move target to 3.x according http://wiki.services.openoffice.org/wiki/Target_3x
Reset assigne to the default "issues@openoffice.apache.org".