Bug 118936 - FILEOPEN DOCX top border is missing for border around text portion
Summary: FILEOPEN DOCX top border is missing for border around text portion
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.4.0
Keywords: filter:docx
Depends on:
Blocks: Borders
  Show dependency treegraph
 
Reported: 2018-07-25 13:38 UTC by Regina Henschel
Modified: 2019-08-10 10:39 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
character style with border, generated by Word 365 (16.59 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-07-25 13:38 UTC, Regina Henschel
Details
Screenhot, Comparison of Word and LibreOffice (123.51 KB, image/png)
2018-07-25 13:45 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2018-07-25 13:38:47 UTC
Created attachment 143751 [details]
character style with border, generated by Word 365

Open the attached file. You should see a cyan shaded word with a border. The border should be on all four sides, but the top border is missing.
Comment 1 Regina Henschel 2018-07-25 13:45:32 UTC
Created attachment 143752 [details]
Screenhot, Comparison of Word and LibreOffice
Comment 2 Xisco Faulí 2018-07-25 15:47:55 UTC
Reproduced in

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.10; Render: default; 

Version: 5.0.0.0.alpha1+
Build ID: 0db96caf0fcce09b87621c11b584a6d81cc7df86
Locale: ca-ES (ca_ES.UTF-8)

Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

but in

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

the other borders weren't even displayed...
Comment 3 Justin L 2019-08-02 15:18:52 UTC
Nasty - multiPropertySet exception took out all remaining properties. CharTopBorder is alphabetically the last of the borders, so it was unceremoniously dropped while the rest were unaffected.

Easy fix at  https://gerrit.libreoffice.org/76875
Comment 4 Justin L 2019-08-03 06:54:14 UTC
This bug report does expose a whole other can of worms though.
1.) The borders are not visible or editable in the Character Styles UI.
2.) UNO_NAME_CHAR_SHADING_VALUE was added to AutoCharStyleMap (but not CharStyleMap) in commit 643db96e933fd03a4e22e1d214a305608e816463. Two months later, support is added for Char Border Shadow (in general for SW?). So perhaps it would be best to convert all of this to use the char shadow settings?

commit f8b6c3949e2c1f23549a2ef879e728cdb7149235
Author: Zolnai Tamás <zolnaitamas2000@gmail.com>
Date:   Wed Aug 21 21:30:41 2013 +0200

    CharBrd 7: Border shadow
    
    1, New character attribute
    - Add the three shadow members to font
    (width, color, location)
    2, Painting
    - Extract the shadow painting to a local function
    and use that for character shadow (paintfrm.cxx)
    - Reduce the painting rectangle of background
    (shadow doesn't inherites the background of content)
    3, Border merge
    - Use text portion join members to skip shadow
    when neccessary.
    4, Vertical text
    - Get shadow space dependant from oritentation and
    border merge.
    5, UNO API and ODF filter
    Paragraph: ParaShadowFormat -> Character: CharShadowFormat


earlier commit 26d40686128e70916a636e20f5ccc5763bbb6cc8
Author: Adam Co <rattles2013@gmail.com>
Date:   Sun Jun 23 10:49:28 2013 +0300

    fdo65400: fix for Character Shading being lost
    
    This bug fixes the DOCX import and export filters, adds a new property
    to the document model and updates the UNO API.
    There is no need to add layout \ UI updates, because in Word
    the only way to turn this on\off is using a simple button,
    and there is no way to control the shading color itself.
    However, ODF import \ export filters should be updated in a future
    commit (which is 643db96e933fd03a4e22e1d214a305608e816463).
Comment 5 Justin L 2019-08-05 05:54:48 UTC
(In reply to Justin L from comment #4)
> 1.) The borders are not visible or editable in the Character Styles UI.
reported as bug 126684

> 2.) UNO_NAME_CHAR_SHADING_VALUE was added to AutoCharStyleMap (but not
> CharStyleMap) in commit 643db96e933fd03a4e22e1d214a305608e816463. Two months
> later, support is added for Char Border Shadow
No, this isn't shadow. It is background shading. Character properties in SW don't have bitmaps/gradients/patterns, just Color (so no XATTR_FILL_STYLE).
Comment 6 Commit Notification 2019-08-06 14:26:35 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/9a19a1235c301f2699157ab44049bdfd54955e8a%5E%21

tdf#118936 writerfilter: MultiPropertySet exception lost properties

It will be available in 6.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2019-08-10 10:39:28 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/dc7b997bb45fcdf3e03da7d94f46e0ca55f86fde%5E%21

tdf#118936 writerfilter: MultiPropertySet retry on exception

It will be available in 6.4.0.

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

Affected users are encouraged to test the fix and report feedback.