Issue 78896

Summary: Paragraph spacings stll active though hidden via character format
Product: Writer Reporter: clutz <chrlutz>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: baumux, chris_mux, issues, mroe.nospam, mux2005
Version: OOo 2.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Example required to reproduce the bug none

Description clutz 2007-06-26 15:16:15 UTC
I will attach a textdocument and a small macro that shows, that there seems to
be an update missing, when a part of the text is beeing hidden.

the text looks like this:
--
Sehr geehrte Damen und Herren,

hier kommt der Text.

Mit freundlichen Grüßen
II.	Abdruck von I.
Polizeiinspektion
III.	WV
Im Auftrag



Max Mux
--

Please Note:
- the line "II. Abdruck von I." is formatted with an paragraph format, that
defines some spacing befor the paragraph.

- the line "Im Auftrag" is formatted with a paragraph format, that does NOT
define any spacings before the paragraph.

My Macro "missingUpdateWhenHidingBug" simply creates a textcursor, places it
over the content "II. Abdruck von I.
Polizeiinspektion
III.	WV" and hides the content.

After hiding the three lines, I would expect the line "Im Auftrag" to be
displayed directly below the line "Mit freundlichen Grüßen" without any spacing
between the two paragraphs. But as you can see when you call the macro for the
first time, there IS a spacing between the two paragraphs.

Here is the macrocode "missingUpdateWhenHidingBug" (it's also included in the
attached document):

Sub missingUpdateWhenHidingBug
    t = ThisComponent.Text
    cursor = t.createTextCursorByRange(t.Start)
	
    cursor.gotoNextParagraph(false) ' place the cursor over the
    cursor.gotoNextParagraph(false) ' text: "II. Abdruck von I.
    cursor.gotoNextParagraph(false) '        Polizeiinspektion
    cursor.gotoNextParagraph(false) '        III. WV"
    cursor.gotoNextParagraph(false)
    cursor.gotoNextParagraph(true)
    cursor.gotoNextParagraph(true)
    cursor.gotoEndOfParagraph(true)

    cursor.CharHidden = true  'And hide the text

'   cursor.CharHidden = false 'uncommenting these two lines is a workaround!
'   cursor.CharHidden = true
End Sub

Here is how to reproduce:
1) Open the attached document missingUpdateWhenHidingBug
2) Call the included macro Standard.Module1.missingUpdateWhenHidingBug
3) now you can see, that there is some spacing between "Mit freundlichen Grüßen"
and "Im Auftrag" which should not be.
4) If you unhide the part of the text (for example via the UI) and call the
macro again, everything seems to be OK.

As I noticed the behaviour described in 4), I got the idea for a workaround:
just set Hidden=true, Hidden=false and Hidden=true again, and everything seems
to be fine. To activate the workaround, simply uncomment the last two lines of
the macro.
Comment 1 clutz 2007-06-26 15:17:24 UTC
Created attachment 46257 [details]
Example required to reproduce the bug
Comment 2 michael.ruess 2007-06-27 07:01:48 UTC
MRU->FME: this also happens when I hide the text via Format.Character directly,
not only via API.
The paragraphs completly vanish, but its "spacing above" is still active.
Comment 3 Martin Hollmichel 2007-09-10 14:09:51 UTC
move to target 3.x according http://wiki.services.openoffice.org/wiki/Target_3x
Comment 4 andreschnabel 2008-07-15 21:01:39 UTC
*** Issue 76411 has been marked as a duplicate of this issue. ***