Apache OpenOffice (AOO) Bugzilla – Issue 78896
Paragraph spacings stll active though hidden via character format
Last modified: 2013-08-07 14:44:35 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.
Created attachment 46257 [details] Example required to reproduce the bug
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.
move to target 3.x according http://wiki.services.openoffice.org/wiki/Target_3x
*** Issue 76411 has been marked as a duplicate of this issue. ***