Issue 77637 - hide/unhide of text sections is not reliable
Summary: hide/unhide of text sections is not reliable
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.2
Hardware: All All
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2007-05-21 08:48 UTC by clutz
Modified: 2017-05-20 11:15 UTC (History)
4 users (show)

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

An example that shows that hiding/unhiding of textsections is not reliable (18.14 KB, application/vnd.oasis.opendocument.text)
2007-05-21 08:50 UTC, clutz
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description clutz 2007-05-21 08:48:07 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
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.
Comment 1 clutz 2007-05-21 08:50:09 UTC
Created attachment 45281 [details]
An example that shows that hiding/unhiding of textsections is not reliable
Comment 2 clutz 2007-05-21 08:56:36 UTC
Sorry, the last section that should be visible is called "Berdeutschland GROUPS
('deutschland')". Please use this instead of "Berenglisch GROUPS

btw. I was able to reproduce the bug on OOo2.2 (linux), OOo 2.0.4 (linux) and
OOo 2.2 (windows)
Comment 3 clutz 2007-05-21 12:40:52 UTC
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.
Comment 4 clutz 2007-06-01 10:37:15 UTC
@mru: could you please assign this issue to someone who feels responsible?
Comment 5 michael.ruess 2007-06-01 13:17:14 UTC
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.
Comment 6 Martin Hollmichel 2007-09-10 13:37:04 UTC
move target to 3.x according
Comment 7 Marcus 2017-05-20 11:15:31 UTC
Reset assigne to the default "".