Issue 75430 - setting CharHidden on a sw-paragraph leaves the paragraph in an undefinded state
Summary: setting CharHidden on a sw-paragraph leaves the paragraph in an undefinded state
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: formatting (show other issues)
Version: OOo 2.2 RC3
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: stefan.baltzer
QA Contact: issues@sw
URL:
Keywords: oooqa, regression
Depends on:
Blocks: 73858
  Show dependency tree
 
Reported: 2007-03-15 16:46 UTC by clutz
Modified: 2013-08-07 14:42 UTC (History)
7 users (show)

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


Attachments
Testdocument on which the issue occurs (10.51 KB, application/vnd.oasis.opendocument.text)
2007-03-15 16:47 UTC, clutz
no flags Details
simplified testdocument (6.74 KB, application/vnd.sun.xml.writer)
2007-03-15 17:08 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-03-15 16:46:23 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.
Comment 1 clutz 2007-03-15 16:47:39 UTC
Created attachment 43729 [details]
Testdocument on which the issue occurs
Comment 2 clutz 2007-03-15 17:07:53 UTC
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.
Comment 3 clutz 2007-03-15 17:08:50 UTC
Created attachment 43730 [details]
simplified testdocument
Comment 4 andreschnabel 2007-03-15 17:15:51 UTC
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?

Comment 5 andreschnabel 2007-03-15 17:17:13 UTC
changed subcmponent and owner
Comment 6 andreschnabel 2007-03-15 17:18:30 UTC
again, this might be the same prolem as issue 75299

mru/sba: can you verify this issue in CWS attrfix?
Comment 7 mux2005 2007-03-15 17:51:05 UTC
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.
Comment 8 stefan.baltzer 2007-03-15 18:16:45 UTC
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
Comment 9 frank.meies 2007-03-16 01:07:24 UTC
fme: The attribute is set correctly but the layout is not invalidated
accordingly. I'll have a look.
Comment 10 frank.meies 2007-03-16 11:32:45 UTC
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'.
Comment 11 frank.meies 2007-03-16 12:17:14 UTC
fme: works correctly when changing the paragraph style:

xstylename = xnext.parastylename

xparastyle =
thiscomponent.stylefamilies.getbyname("ParagraphStyles").getbyname(xstylename)

xparastyle.charhidden = true

xparastyle.charhidden = false
Comment 12 clutz 2007-03-16 12:48:53 UTC
@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. 
Comment 13 frank.meies 2007-03-19 15:52:38 UTC
FME: Fixed in cws hiddenfix, sw/source/core/txtnode/thints.cxx rev. 1.43.36.4.10.1
Comment 14 frank.meies 2007-03-19 15:53:31 UTC
FME: Ready for QA.
Comment 15 stefan.baltzer 2007-03-19 17:23:45 UTC
SBA: Verified in CWS hiddenfix.
Comment 16 Martin Hollmichel 2007-03-19 17:41:47 UTC
set target 2.2
Comment 17 stefan.baltzer 2007-03-22 14:49:08 UTC
SBA: OK in OOF680_m13 Build 9131. Closed.