Bug 132776 - FILESAVE: Bug when you apply customized gradient to paragraph and then save/open
Summary: FILESAVE: Bug when you apply customized gradient to paragraph and then save/open
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.4.2 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.3.0 target:7.2.0.0.beta2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2020-05-06 14:18 UTC by Mauro
Modified: 2023-04-19 21:28 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro 2020-05-06 14:18:11 UTC
Description:
If you apply a customized gradient to a selection of paragraphs, and then save the document, after you reopen it the gradient will look messed up (it's like libreoffice didn't save your customized values of the gradient).

Steps to Reproduce:
1. Open Writer and write some paragraphs of text, like:

Paragraph1 text.
Paragraph2 text.
Paragraph3 text.
...
...

2. Select all the paragraphs and go in "Paragraph" options.
3. In the "Area" tab select "Gradient". 
4. Select whatever gradient you want and change some value of the gradient. For example, change the Angle value or the Border value, etc.
5. Click OK. You'll see the gradient is correctly applied to all the paragraphs you selected.
6. Save the document and close it or close the Writer application.
7. Reopen the above document.

RESULT: the gradient in the paragraphs is all messed up!


Actual Results:
The gradient in the paragraphs of the reopened document is all messed up!

Expected Results:
You expect the gradient you see after reopening the document to be the same you correctly saw before you saved it.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Bug present on versions: 6.3.6.2 (x64) and 6.4.3.2 (x64). I don't know if it affects earlier versions too.
Comment 1 Mauro 2020-05-07 13:30:08 UTC
I can confirm the bug even on Ubuntu Linux 18.04 LTS.

It uses:

LibreOffice Version: 6.0.7.3
Build ID: 1:6.0.7-0ubuntu0.18.04.10
Comment 2 Timur 2021-05-07 10:14:53 UTC
Repro 7.2+. Not seen in 6.0, seen in 6.1, regression.
Comment 3 Justin L 2021-05-10 16:19:00 UTC
I don't see the problem in 6.1 or 6.2.  Regression started in 7.0 and backported to 6.3.4.  Using bibisect-linux-x64-6.3, I got
commit 53c474633c4e658f096669fb0225d751a5701aaf
author	Gabor Kelemen on Tue Nov 19 10:25:49 2019 +0100
   tdf#125449 Fix custom gradient fill settings being lost

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

For my testing, I selected the blue radial gradient, and then changed the setting from radial to elliptical.  When re-loaded, the result was linear with black/white.
Comment 4 Justin L 2021-05-29 07:31:14 UTC
A workaround is to assign a unique name to a custom gradient/hatch as implemented in SD. (https://gerrit.libreoffice.org/c/core/+/107258 which contains links to unit tests in the comments).

Needed here in Writer for hatches and gradients too. sw/source/uibase/shells/textsh1.cxx case SID_PARA_DLG:

As noted in one commit
> However tdf#99908 shows that ODF import doesn't like anonymous
> gradients. This is a bug in xmloff style import and should eventually
> be fixed there. Here we implement the same band-aid solution
> tdf#99908 implements for Impress sidebar
Comment 5 Justin L 2021-06-21 15:05:51 UTC
proposed fix at https://gerrit.libreoffice.org/c/core/+/117594
Comment 6 Commit Notification 2021-07-05 06:34:38 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3f6797c29e9672eba354400f24a669244fd746c0

tdf#132776 sw UI: make unique names for custom hatch and gradient

It will be available in 7.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 7 Commit Notification 2021-07-05 08:08:04 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/357e52fd878225d5b7a23eda53514e076b2cd61a

tdf#132776 sw UI: make unique names for custom hatch and gradient

It will be available in 7.2.0.0.beta2.

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 8 BogdanB 2021-07-08 20:20:09 UTC
Solved. Verified in
Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: eac5977bfc11797eda356560a5e45c51108ef5a1
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded