Apache OpenOffice (AOO) Bugzilla – Issue 75430
setting CharHidden on a sw-paragraph leaves the paragraph in an undefinded state
Last modified: 2013-08-07 14:42:35 UTC
I'm testing OOo2.2 (680m8, Build 9119) and I have got the following regession (the bug doesn't occur in older OOo-Versions): There is a macro that hides a paragraph and shows the paragraph again using the following lines: par.CharHidden = true par.CharHidden = false after resetting the hidden state, the paragraph is not shown in the writer document, and there is no way to get the paragraph displayed again. To reproduce procede the following steps: 1) open the attached document hideAndShowProblem.odt 2) run the following macro that simply hides the 3rd Paragraph ("Abdruck von I.") and tries to show it again: Sub hideAndShow xenum = ThisComponent.Text.createEnumeration() for i = 1 to 3 par = xenum.nextElement() next i par.CharHidden = true par.CharHidden = false End Sub 3) Now you can see that the 3rd paragraph "Abdruck von I." is no longer displayed.
Created attachment 43729 [details] Testdocument on which the issue occurs
I created a simplified testdocument that contains 4 paragraphs formatted in the paraStyle "Standard", but in the 3rd paragraph I used the CharacterStyle "Quelltext" for the first letter. It seems the bug occurs if there are different CharacterStyles used in the regarding paragraph.
Created attachment 43730 [details] simplified testdocument
confirmed. As I can produce the beaviour by manually editing the charecter styles, I change the component to word processor. this might be the same problem as issue 75299 @sba, can you please check with cws attrfix?
changed subcmponent and owner
again, this might be the same prolem as issue 75299 mru/sba: can you verify this issue in CWS attrfix?
I'd like to add that our printing system for "Sachleitende Verfügungen" (something very important in a public administration environment) depends on this, so this is a showstopper for us. We can't upgrade to 2.2 until this is fixed.
SBA: Looks like this is the same root cause (CWS swautomatic), but this problem is NOT solved in CWS attrfix (OOFm11). One workaround indeed "smells" linke something very similar. - Select the line in question - Context -> Default Formatting (removes character styles) - Run Macro -> Unhide works (click Undo button twice to see that it was applied) Easy Workaround: Switch on the nonprinting characters. Reassigned to FME, set target OOo 2.2.1, put MRU on c/c
fme: The attribute is set correctly but the layout is not invalidated accordingly. I'll have a look.
fme: These are the conditions of the bug: 1. disable "show non printing characters" *and* 2. set a *character style* at a paragraph or at some characters within the paragraph *and* 3. set a *hard* attribute 'hidden' (if the paragraph is currently not hidden) or 'not-hidden' (if the paragraph is currently hidden) at the whole paragraph. If these conditions are met the layout is not invalidated. This also can be observed using the UI. Note that the attribute is set correctly, only the invalidation of the layout is not triggered. The layout invalidation can be triggered manually by toggling 'show non-printing characters'.
fme: works correctly when changing the paragraph style: xstylename = xnext.parastylename xparastyle = thiscomponent.stylefamilies.getbyname("ParagraphStyles").getbyname(xstylename) xparastyle.charhidden = true xparastyle.charhidden = false
@SBA: thanks for the workaround, but they are both not applicable for us: >One workaround indeed "smells" linke something very similar. > - Select the line in question > - Context -> Default Formatting (removes character styles) > - Run Macro > -> Unhide works (click Undo button twice to see that it was applied) There are many paragraphs involved in my hide-show scenario. After doing the unhide I would have to restore the original formattings of all the paragraphs. Therefore a temporary storage for the formatting options of each textportion in the paragraphs would be required -> too much effort for a feature that worked fine with older Versions of OOo. > Easy Workaround: > Switch on the nonprinting characters. This is also not applicable since we use a method that computes the (exact) number of printed pages. Switching on the nonprinting characters diverts the result which harms other features of our letterhead-system.
FME: Fixed in cws hiddenfix, sw/source/core/txtnode/thints.cxx rev. 1.43.36.4.10.1
FME: Ready for QA.
SBA: Verified in CWS hiddenfix.
set target 2.2
SBA: OK in OOF680_m13 Build 9131. Closed.