Bug 114449 - Horizontal line uno command
Summary: Horizontal line uno command
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: UNO-Command-New ODF-spec Horizontal-Line
  Show dependency treegraph
Reported: 2017-12-14 00:52 UTC by Yousuf Philips (jay) (retired)
Modified: 2017-12-15 22:52 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2017-12-14 00:52:50 UTC
Insert > Horizontal Line doesnt actually insert a horizontal line, but instead changes the paragraph to the 'Horizontal Line' paragraph style, which if done on a line/paragraph with text, it will not have the desired result.

So the new horizontal line uno command should insert 2 paragraph breaks at the current position of the cursor (without triggering any autocorrect triggers) and then move the cursor up once, then assign the 'Horizontal Line' paragraph style, and finally move the cursor left once.

Once the uno command is create it would replace .uno:StyleApply?Style:string=Horizontal Line&FamilyName:string=ParagraphStyles entry in writer's menubar.xml.

Comment 1 Heiko Tietze 2017-12-14 07:58:19 UTC
Do you expect a drawing object, a line with zero height, anchored at the paragraph, not interactive or at least secured against unintentional movements, probably adding space itself?
The border solution is always perfectly placed and sized, easy to modify by users, and also autotext'ed when entering ----------------.
Comment 2 Yousuf Philips (jay) (retired) 2017-12-15 00:09:56 UTC
Regina: Does ODF have a horizontal line object equivalent to OOXML's horizontal line (bug 97648), which unfortunately we are currently converting into a drawing object that wont adapt to changes in the page's size/margins.
Comment 3 Regina Henschel 2017-12-15 01:24:05 UTC
ODF has no special element for a horizontal line.

The horizontal line is a picture-element with a rectangle as content anchored as character in Word. So the import as rectangular shape is correct. LibreOffice misses the implementation of the here needed attribute "style:rel-width" of the <style:graphic-properties> element.


Bug 45884 is related.
Comment 4 Yousuf Philips (jay) (retired) 2017-12-15 22:52:05 UTC
(In reply to Regina Henschel from comment #3)
> ODF has no special element for a horizontal line.
> The horizontal line is a picture-element with a rectangle as content
> anchored as character in Word.

Well for correct interopability with OOXML and other document formats, ODF will need something to identify the difference between a shape and a horizontal line, like how OOXML has it. OOXML uses the o:hr, o:hrstd, o:hrnoshade, o:hrpct, o:hralign attributes of the <v:rect> tag to represent this difference.


> So the import as rectangular shape is correct.

I believe it is incorrect to import it as a rectangular shape with a fill color and an undefined border line, but instead it should be imported as a defined line shape, but with the ability to extend its height similar to a rectangle shape. This will allow correct interopability with other document formats where you can define the line style, which isnt possible with a rectangular shape.