Bug 101826 - textbox background fill lost when round-tripping in .doc
Summary: textbox background fill lost when round-tripping in .doc
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.3.0
Keywords: bibisected, bisected, filter:doc, regression
: 85283 112618 (view as bug list)
Depends on:
Blocks: DOC-Textbox Regressions-alg_writerframes
  Show dependency treegraph
 
Reported: 2016-08-31 17:26 UTC by Justin L
Modified: 2019-09-30 12:47 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
textboxMargins.doc: should have a gray background when round-tripped (23.00 KB, application/msword)
2016-08-31 17:26 UTC, Justin L
Details
All fill types are lost on roundtrip (766.50 KB, application/msword)
2018-03-09 23:33 UTC, Luke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2016-08-31 17:26:13 UTC
Created attachment 127099 [details]
textboxMargins.doc: should have a gray background when round-tripped

LibreOffice reads the original word document fine, but when saving and re-opening, the gray background on the textbox is lost.

Tested and bisected on Linux 16.04 with bibisect-43max

Bibisected to the huge patch (Files 119, -1182/+4572 lines)
    commit 6e61ecd09679a66060f932835622821d39e92f01
    Author:     Armin Le Grand <alg@apache.org>
    CommitDate: Fri Mar 28 14:31:08 2014 +0100
    
        Merge back branch alg_writerframes to trunk
Comment 1 Justin L 2016-09-07 06:55:53 UTC
I can't figure this one out and didn't have any success hacking the source code.  I'm guessing that it is a transition from SvxBrushItem to XATTR_FILLCOLOR (XFillColorItem) and XATTR_FILLSTYLE (XFillStyleItem).  However, ADDING these attributes to the frame during import didn't help (and seemed to get lost).

The frame's Area-Fill-Tab and the sidebar do not recognize the current color or fillstyle either.
Comment 2 Aron Budea 2016-09-07 13:11:35 UTC
Confirmed in 5.2.1.2 / Ubuntu.

Let's add Armin to the loop, then.
Comment 3 Aron Budea 2016-09-07 13:56:14 UTC
Other bugs connected to this commit: bug 94287, bug 85283, bug 92095, bug 80294.
(might not be that useful to know, since it's a large commit, but still interesting)
Comment 4 Xisco Faulí 2016-09-26 15:03:08 UTC
Adding Cc: to Armin Le Grand
Comment 5 Xisco Faulí 2017-09-24 23:00:38 UTC
*** Bug 112618 has been marked as a duplicate of this bug. ***
Comment 6 Luke 2018-03-09 23:33:50 UTC
Created attachment 140527 [details]
All fill types are lost on roundtrip

Here is an example with gradient, pattern, and picture fills.

Miklos, 

I know you have done a lot of work in this area. Any idea why Armin's commit would have broken this functionality?
Comment 7 Justin L 2019-01-14 15:42:52 UTC
magic fix proposed at https://gerrit.libreoffice.org/66310
Comment 8 Commit Notification 2019-01-21 17:45:37 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#101826 ww8import: add XATTR_* to textbox attr set

It will be available in 6.3.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 9 Justin L 2019-01-21 17:48:58 UTC
Enhancements are still possible because the XATTR_* properties are being translated into RES_BACKGROUND, and then back out to XATTR_* again, so if the conversion can be avoided, then better color results can be achieved.  

Exploratory patch at https://gerrit.libreoffice.org/66331
Comment 10 Justin L 2019-01-22 18:40:17 UTC
*** Bug 85283 has been marked as a duplicate of this bug. ***
Comment 11 Commit Notification 2019-04-30 13:14:42 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#101826 ww8import: Fly - don't convert XATTR back and forth

It will be available in 6.3.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 12 Commit Notification 2019-05-25 09:00:52 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#101826 ww8import: Fly - do convert XATTR if FILLSTYLE==NONE

It will be available in 6.3.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 13 Justin L 2019-05-25 09:26:34 UTC
There is still a possible outstanding edge case. If the parents have a transparency, but some XATTR is set but without setting the transparency, then the inherited transparency might be lost (at least based on the previous code path). I couldn't create/find an example document of that though.
Comment 14 Xisco Faulí 2019-05-27 12:05:43 UTC
Verified in

Version: 6.3.0.0.alpha1+
Build ID: 53325b40b557cc84d8d21c1baa0ef8d3bfc00ab8
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Justin Luth, Thanks for fixing this issue!!