Bug 97648 - Horizontal line is not imported
Summary: Horizontal line is not imported
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.0.4 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.0.0 target:6.1.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Limitations OOXML-Shapes Horizontal-Line
  Show dependency treegraph
 
Reported: 2016-02-08 15:15 UTC by Oliver Specht (CIB)
Modified: 2017-12-16 16:58 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Document with green horizontal line (12.56 KB, application/wps-office.docx)
2016-02-08 15:15 UTC, Oliver Specht (CIB)
Details
sample docx with various horizontal lines (13.05 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-12-14 23:59 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Specht (CIB) 2016-02-08 15:15:54 UTC
Created attachment 122444 [details]
Document with green horizontal line

Line picture is not visible.

<w:pict>
 <v:rect id="_x0000_i1025" style="width:448.6pt;height:5.7pt" o:hrpct="989" o:hralign="center" o:hrstd="t" o:hrnoshade="t" o:hr="t" fillcolor="#cfc" stroked="f"/>
</w:pict>
Comment 1 Joel Madero 2016-02-08 18:46:12 UTC
Bodhi Moksha
LibreOffice 5.0.2.2 (updating version)

This one might actually be a regression, would be good to test older versions: http://downloadarchive.documentfoundation.org/libreoffice/old/

New
Normal: Can prevent high quality work/interoperability
Medium: Seems like a normal test case, just a horizontal line in a document goes missing.
Comment 2 Yousuf Philips (jay) (retired) 2017-09-05 11:47:12 UTC
still the same

Version: 6.0.0.0.alpha0+
Build ID: fc61be93c60967bf1d6bcffcada8189016d4530e
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-09-05_00:50:38
Locale: en-US (en_US.UTF-8); Calc: group
Comment 3 Justin L 2017-09-05 18:02:33 UTC
Kindof a regression.  It at least showed the line before 3.6 anchored to paragraph. After that, the tiny size of 0.02x0.08 makes it almost impossible to find the to-character line.

Used bibisect43all to identify the range and then eyeballed and verified that the line disappeared after commit 96c7ab19b77c2f90acd4c34552474b0f616f48a7
author Luboš Luňák 2012-05-28 16:06:14 (GMT)
>hack the same meaning for o:hr handling like MSO uses
>This doesn't in fact change much in LO, since ShapeType::getAbsRectangle()
>uses 0 as the reference size, 100% is still actually 0.
Comment 4 Justin L 2017-09-08 01:44:08 UTC
proposed partial solution: https://gerrit.libreoffice.org/42088

I'm not assigning myself to this bug because ultimately it needs to support the "100%" nWidth=0 case - which is the most common one. However, although the variables seem to be present to handle maWidthPercent, the back-end code doesn't seem to use it at all for the horizontal line shape.

Also needed is something to handle o:hralign. Again, the variables seem to exist for it, but the back-end code doesn't actually affect the o:hr shape.
+        OUString hralign = rAttribs.getString( O_TOKEN( hralign ), "left" );
+        mrTypeModel.maPositionHorizontal = hralign;

I'm a bit afraid of hacking on this low level vml library code, since I will be changing a lot more than just horizontal lines...
Comment 5 Justin L 2017-09-10 03:07:29 UTC
https://gerrit.libreoffice.org/42127 tdf#97648 ooxmlimport: implement horizontal adjustment

https://gerrit.libreoffice.org/42128 tdf#97648 ooxmlimport: calculate percentage-based widths
Comment 6 Commit Notification 2017-09-11 10:32:38 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c14be5f5545768fc06bd1e3900e076dc28be2649

tdf#97648 vml import: fix horizontalLine percentage

It will be available in 6.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Justin L 2017-09-18 15:33:40 UTC
For documentation purposes, here is a list of existing unit tests that have a width smaller than the percentage-width I calculate using PROP_RelativeWidth:

effectextent-margin.docx - make CppunitTest_sw_ooxmlexport
NoFillAttrInImagedata.docx  - make CppunitTest_sw_ooxmlexport2
textbox_picturefill.docx - ooxmlexport4
pagerelsize.docx - ooxmlexport4
lvlPicBulletId.docx - ooxmlexport4
dml-shape-relsize.docx - ooxmlexport6
floating-tables-anchor.docx - ooxmlexport8
tdf89165.docx - ooxmlexport8
fdo68607.docx - ooxmlexport8
tdf84678.docx - ooxmlexport9
tdf104115.docx - ooxmlexport9 NEGATIVE WIDTH!!!
fdo76316.docx - fieldexport

textbox-wps-only.docx - ooxmlimport

relsize.rtf - rtfexport
fdo94835.rtf - rtfexport2
fdo79319.rtf - rtfimport    -FIXES A FIXME!!!!!!
Comment 8 Commit Notification 2017-12-04 14:05:57 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b360322c63d62b54b5e6adac4def3f8b761dc1da

tdf#97648 ooxmlimport: calculate percentage-based widths

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2017-12-07 04:20:12 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9644f506ae31f1cacd6ab4c24b2591179791eebd

tdf#97648 ooxmlimport: horizontal lines have no margins

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Yousuf Philips (jay) (retired) 2017-12-14 23:59:07 UTC
Created attachment 138454 [details]
sample docx with various horizontal lines
Comment 11 Commit Notification 2017-12-16 16:48:48 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=610d98bd93e8032b9bfb48dc2ed0cd4d35c23ddd

tdf#97648 ooxmlimport: horizontal line's horiOrient

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Justin L 2017-12-16 16:58:30 UTC
bug 114449 is looking at the bigger issue of how horizontal lines are handled.
Anyway, I exhausted my set of patches, and the main issue is resolved, so closing this issue as fixed.