Issue 78896 - Paragraph spacings stll active though hidden via character format
Summary: Paragraph spacings stll active though hidden via character format
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.2
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
: 76411 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-06-26 15:16 UTC by clutz
Modified: 2013-08-07 14:44 UTC (History)
5 users (show)

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


Attachments
Example required to reproduce the bug (13.32 KB, application/vnd.oasis.opendocument.text)
2007-06-26 15:17 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-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. ***