Bug 142144 - FILESAVE: Paragraph area gradient in ODT not saved in DOC or DOCX
Summary: FILESAVE: Paragraph area gradient in ODT not saved in DOC or DOCX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisectNotNeeded, filter:doc, filter:docx, regression
: 142163 (view as bug list)
Depends on:
Reported: 2021-05-07 08:19 UTC by Timur
Modified: 2021-08-23 10:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Test ODT with background (138.76 KB, application/vnd.oasis.opendocument.text)
2021-05-07 08:19 UTC, Timur
Test ODT saved as DOCX in Lo 4.3 (4.10 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-05-07 10:46 UTC, Timur
Test ODT saved as DOC in Lo 4.3 (9.00 KB, application/msword)
2021-05-07 10:46 UTC, Timur

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2021-05-07 08:19:02 UTC
Created attachment 171732 [details]
Test ODT with background

Paragraph area gradient from ODT is not saved when it's saved as DOC or DOCX. 
Problem started from LO 4.4.0 and was reported in bug 88583 where bibisect was done and issue resolved for paragraph area fill.

Paragraph area gradient is still wrong as seen in comparison attachment 171702 [details] of test ODT document  attachment 112460 [details] saved as DOCX and DOC compared in LO 4.3, LO 7.2+ and MSO
I add here extended test ODT, because saving in ODT of paragraph area gradient has a bug 132776.
Comment 1 Miklos Vajna 2021-05-07 09:13:50 UTC
Sorry, this is too vague for me to confirm. Could you please 1) point out which commit is the problematic one and 2) attach the old good and the new bad DOCX output? I'm confused how DOCX would represent gradient backgrounds, and even more unsure how this used to work in the past. :-)

Comment 2 Timur 2021-05-07 10:46:23 UTC
Created attachment 171738 [details]
Test ODT saved as DOCX in Lo 4.3

Here is good output DOCX from LO 4.3.5 for attachment 112460 [details].
Comment 3 Timur 2021-05-07 10:46:55 UTC
Created attachment 171739 [details]
Test ODT saved as DOC in Lo 4.3

Here is good output DOC from LO 4.3.5 for attachment 112460 [details].
Comment 4 Timur 2021-05-07 11:11:09 UTC
Bibisect is in https://bugs.documentfoundation.org/show_bug.cgi?id=88583#c7

Looks like this one in 44max:
commit e642812606be49244f2f775e90169fbd1be29a97 
Date:   Sat Mar 14 22:28:59 2015 +0800

    commit 7d9bb549d498d6beed2c4050c402d09643febdfa
    Author:     Armin Le Grand <alg@apache.org>
    AuthorDate: Mon Jun 2 15:00:50 2014 +0000
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Tue Jul 1 13:30:09 2014 +0200
        Related: #i124638# Second step of DrawingLayer FillAttributes...
        for Writer objects, now added support for Paragraph and PageStyle (including Header and Footer) for direct attributes and style attributes
        (cherry picked from commit cc25c58f7052827bfebdc9fbeec668c8fa29ed1b)

I don't see that MSO has paragraph color, but this was working somehow.
Comment 5 NISZ LibreOffice Team 2021-05-07 12:58:10 UTC
The < 4.4 versions converted the area fill gradient to paragraph background color (shading), which is a single color instead of two.

As far as I see Word does not have an equivalent of paragraph background gradient.
Comment 6 Timur 2021-05-10 10:02:42 UTC
*** Bug 142163 has been marked as a duplicate of this bug. ***
Comment 7 Regina Henschel 2021-05-10 22:04:43 UTC
I think this bug report should be resolved as "not our bug". The ooxml format has no way to store a gradient as background of a paragraph. The paragraph background is set in the w:shd element ( shd (Paragraph Shading)). And that has only solid fill and pattern.
Comment 8 Timur 2021-05-11 06:38:16 UTC Comment hidden (obsolete)
Comment 9 Regina Henschel 2021-05-11 14:22:25 UTC
(In reply to Timur from comment #8)
> But:
> - it used to work, how
> - can it be saved in LO namespace, until and unless DOCX has it.

Do you mean, to add something to DOCX, so that the gradient is recreated on opening? Although Word would not be able to display it? Why would you need it? You can save as .odt to keep the gradient.
Comment 10 Timur 2021-05-11 15:41:15 UTC
Yes, but on 2nd thought better to save as what MSO can read, as it was.
Comment 11 Justin L 2021-08-23 09:30:37 UTC
Before LO fill was overhauled to use XATTR_FILLGRADIENT, I assume that this was a RES_BACKGROUND gradient that on export was converted to one solid colour. In this particular instance it looked good.

Since DOC/X does not have these gradients, it must be emulated. And the end result will very much depend on the situation and the viewer's perception of whether the chosen colour out of the gradient is "good" or not. Perhaps it is best to not do anything at all (like we are currently doing) to emphasize that MS formats can't feature-match LO in this area. It forces the user to design the document correctly for their output of choice.