Bug 155913 - MCGR: Transparency gradient must not have steps ("Increment" in UI)
Summary: MCGR: Transparency gradient must not have steps ("Increment" in UI)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Armin Le Grand
URL:
Whiteboard: target:24.2.0 target:7.6.0.0.beta2
Keywords: bibisectRequest, implementationError, regression
Depends on:
Blocks:
 
Reported: 2023-06-18 14:27 UTC by Regina Henschel
Modified: 2023-07-05 12:56 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Color gradient with 4 steps and linear transparency gradient (30.93 KB, application/vnd.oasis.opendocument.graphics)
2023-06-18 14:27 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-06-18 14:27:51 UTC
Created attachment 187974 [details]
Color gradient with 4 steps and linear transparency gradient

Open attached document created with LO 7.5. It has a shape with a 4 step color gradient and an orthogonal linear transparency gradient. Below the shape is a screenshot how it looks in LO 7.5.

The error is that the step count 4 is applied to the transparency gradient too. The corresponding attribute in ODF 1.3 is

<quote>
20.137 draw:gradient-step-count
The draw:gradient-step-count attribute specifies the gradient step count of a color interpolation.
        ●Value 0 means that the step count is automatically calculated on the size and resolution of the filled area. 
        ●Values 1 and 2 shall not be used. 
        ●Values of 3 or greater mean that the step count is that fixed value. 
A gradient step count of color interpolation may be above 256.
</quote>

That is very clear, that the draw:gradient-step-count is only applicable to the color interpolation. There exists no similar attribute for an applied draw:opacity element.

The current behavior in LO7.5 is correct and confirms to the standard. The behavior must not change with introducing multicolor gradients.
Comment 2 Armin Le Grand 2023-06-26 10:00:57 UTC
@Regina: I thought that this is an error/oversight (what it might be). I see no reason to not have that attribute also for TransparencyGradient.
Historically I would guess that it just was 'forgotten' for TransparencyGradients in the ODF spec.

But: Of course - if it is like that - I can just remove that again. Are you sue I should remove that again or maybe we should add that feature to TransparencyGradients...?
Comment 3 Regina Henschel 2023-06-26 11:34:56 UTC
I'm sure it has to be removed. I don't remember any user request that a transparency gradient should be stepped.
Rendering it stepped would affect old documents too and is not backward compatible.
So for transparency gradients, step count is always 0, meaning 'automatic'.

This "stepped" is a legacy feature from StarOffice and not used in any other application. I would not support to extend ODF to use it for transparency gradients.

I would have already changed the mentioned part, but I was not sure, whether other parts have to be changed in addition.

BTW: Intensity is always 100% for transparency gradient, on both start and end. ODF has not even an attribute for it in the transparency gradient element <draw:opacity>.
Comment 4 Armin Le Grand 2023-06-30 08:42:02 UTC
Okay, lets do so.

Thinking about if it makes sense to then really not have that values in the core for transparency gradient.

Also: What about UNO API, should
  XFillFloatTransparenceItem::QueryValue
and
  XFillFloatTransparenceItem::PutValue
do something different as the XFillGradientItem versions (which get called) fr cases
  MID_GRADIENT_STARTINTENSITY
  MID_GRADIENT_ENDINTENSITY
  MID_GRADIENT_STEPCOUNT
...?
Comment 5 Armin Le Grand 2023-06-30 09:15:08 UTC
Changed that, see https://gerrit.libreoffice.org/c/core/+/153799.
Also (experimentally) changed UNO API to reflect that these attributes do not exist (for ODF and thus for UNO API?) by creating errors when using them, as UNO API requires. This is not urgently necessary, but let's see if something triggers (and usages are found) or not...
Comment 6 Commit Notification 2023-06-30 15:47:26 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/59abf300e342556ad9cdcd5fd57b9d887776c441

MCGR: tdf#155913 Non-supported attributes for TransparenceGradient

It will be available in 24.2.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 Regina Henschel 2023-07-01 13:46:36 UTC
The rendering is now as before without MCGR. Tested with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: c1fe534ae49e7e97b5965a5d1fbf910598215102
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL threaded

I have tested macros too, which use a transparency gradient. I have found no problem. I think it should go into 7.6.
Comment 8 Commit Notification 2023-07-03 09:29:39 UTC
Armin Le Grand (allotropia) committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/a0f8a23bc1f4d796ed88d9eb07c3a5d856f66ce2

MCGR: tdf#155913 Non-supported attributes for TransparenceGradient

It will be available in 7.6.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.