Bug 155852 - MCGR FILESAVE PPTX export of stepped gradient has wrong colors
Summary: MCGR FILESAVE PPTX export of stepped gradient has wrong colors
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.6.0.0 beta1+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:24.2.0 target:7.6.0.0.beta2
Keywords: implementationError
Depends on:
Blocks: OOXML-Object-Fill
  Show dependency treegraph
 
Reported: 2023-06-15 11:15 UTC by Regina Henschel
Modified: 2023-06-20 07:11 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
examples with draw:gradient-step-count=4 (65.72 KB, application/vnd.oasis.opendocument.presentation)
2023-06-15 11:15 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-15 11:15:33 UTC
Created attachment 187923 [details]
examples with draw:gradient-step-count=4

Open attached fodp document and export it to pptx.
Open saved pptx document and compare it with original fodp document.

Errors:
 Some colors are different from original colors.
 Some sections have gradients but should be single-colored.

I think the problem is, that the step colors are calculated different in rendering in LO than in export to OOXML.

Compare the rendering calculation in https://opengrok.libreoffice.org/xref/core/vcl/source/outdev/gradient.cxx?r=dccd82b5#341
with export calculation in https://opengrok.libreoffice.org/xref/core/basegfx/source/tools/bgradient.cxx?r=cdc015ff&fi=doApplySteps#760

Significant difference is on the one hand
  const double fAlpha = static_cast<double>(i) / fStepsMinus1;
and on the other hand
  const double fSingleStep(1.0 / static_cast<double>(nStepCount));
Comment 1 Regina Henschel 2023-06-15 23:54:55 UTC
Patch is in https://gerrit.libreoffice.org/c/core/+/153154
Comment 2 Commit Notification 2023-06-16 08:36:08 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2b1b2a758cc4666c6cf6b147722223281dfe1f30

tdf#155852 same method for StepCount in OOXML as in rendering

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 3 Commit Notification 2023-06-20 07:11:56 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/2910dad56c85348d11c428ec20dc57d88ba1d946

tdf#155852 same method for StepCount in OOXML as in rendering

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.