Bug Hunting Session
Bug 94731 - Look of square/quadratic gradient changed
Summary: Look of square/quadratic gradient changed
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.1.6.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ODF-import Object-Fill
  Show dependency treegraph
 
Reported: 2015-10-03 12:23 UTC by Yousuf Philips (jay) (retired)
Modified: 2019-12-03 15:44 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (10.03 KB, application/vnd.oasis.opendocument.text)
2015-10-03 12:23 UTC, Yousuf Philips (jay) (retired)
Details
master vs 3.3 (80.13 KB, image/png)
2015-10-03 20:28 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2015-10-03 12:23:55 UTC
Created attachment 119237 [details]
sample file

In LO 4.1, the gradient labelled 'Square' was renamed to 'Quadratic' and its look was altered to always show as a square even when the shape was a rectangle. This causes problems as other odf software (calligra, mso) show it in the old way, and ooxml files import with the incorrect looking square gradient.

Also the gradient labelled 'Rectangular' was also changed 'Square' at the same time and this doesnt correspond to how the gradient looks.

As this also is in AOO 4.1.1, i'm assuming it was merged from their code. The XML has them as <draw:gradient draw:style="square"> and <draw:gradient draw:style="rectangular">.

With the sample attachment, drag the bottom part of the square shapes to test the behaviour between 4.0 and master.

Version: 5.1.0.0.alpha1+
Build ID: ef1bafb588eb20a5d35df14e79a1a948885c721a
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-09-29_23:55:44
Locale: en-US (en_US.UTF-8)
Comment 1 Regina Henschel 2015-10-03 16:56:02 UTC
Please do not mix handling of ODF with problems in OOXML import and export.

ODF is very clear, how draw:style="square" should look. Read section 19.218.2<draw:gradient>, item 'square',
"square: defines a gradient that produces a square blend, imitating the visual perspective in a corridor or the aerial view of a pyramid. Also known as "box gradient" and "pyramidal gradient". The center of the square is defined with the draw:cx and draw:cy attributes. The width and height of the square is the minimum value of either the width or the height of the filled area. The outside of the square is filled with the end color."

LibeOffice shows it correctly in most cases. Only transparent gradient in presentation mode is wrong. The names in the UI are wrong for en-US. In German the gradients in Area dialog have the correct "Quadratisch" for draw:style="square" and "Rechteckig" for draw:style="rectangle", but German is wrong in the other cases too.

I think, not the drawing is wrong, but the naming in the UI.


OOXML import and export should be an own issue, but nevertheless a comment: OOXML has only the gradient types 'linear' and 'path based'. For 'path' it has the values 'circle', 'rect' and 'shape'. So there exists no direct mapping for ODF draw:style="square". Read annex L.4.8.4.2, and section 20.1.10.38 ST_PathShadeType, and section 20.1.8.33 gradFill; all in ECMA-376, 4th Edition; Office Open XML File Formats — Fundamentals and Markup Language Reference; December 2012. The nearest mapping would be to 'rect' and calculate its corner positions based on the current shape in a way, that the gradient area is a square.
Comment 2 Yousuf Philips (jay) (retired) 2015-10-03 20:28:18 UTC
Created attachment 119249 [details]
master vs 3.3

(In reply to Regina Henschel from comment #1)
> ODF is very clear, how draw:style="square" should look. Read section
> 19.218.2<draw:gradient>, item 'square',
> "square: defines a gradient that produces a square blend, imitating the
> visual perspective in a corridor or the aerial view of a pyramid. Also known
> as "box gradient" and "pyramidal gradient". The center of the square is
> defined with the draw:cx and draw:cy attributes. The width and height of the
> square is the minimum value of either the width or the height of the filled
> area. The outside of the square is filled with the end color."

If the ODF was very clear, calligra and MSO would show it the same way as LO currently shows it. When i read this, "The width and height of the square is the minimum value of either the width or the height of the filled area.", LO doesnt seem to follow this, as it doesnt alter the minimum square to the minimum width or height, as seen in the attached screenshot. It keeps the square as large as the maximum value of either the width or height.

> OOXML import and export should be an own issue, but nevertheless a comment:
> OOXML has only the gradient types 'linear' and 'path based'. For 'path' it
> has the values 'circle', 'rect' and 'shape'. So there exists no direct
> mapping for ODF draw:style="square". Read annex L.4.8.4.2, and section
> 20.1.10.38 ST_PathShadeType, and section 20.1.8.33 gradFill; all in
> ECMA-376, 4th Edition; Office Open XML File Formats — Fundamentals and
> Markup Language Reference; December 2012. The nearest mapping would be to
> 'rect' and calculate its corner positions based on the current shape in a
> way, that the gradient area is a square.

Would be great if you could provide a link to this, so i could read more about it. Word 2010 imports both ODF draw:style="square" and draw:style="rectangular" as rectangular gradient.
Comment 3 Regina Henschel 2015-10-04 12:56:38 UTC
Information about support of ODF 1.2 in Word, Excel and PowerPoint are available from https://msdn.microsoft.com/en-us/library/gg548604%28v=office.12%29.aspx. It is document [MS-OODF3]. (The other files might interest you too.)

ECMA-376 is available from http://www.ecma-international.org/publications/standards/Ecma-376.htm. You need part 1.

ISO/IEC 29500 is available from http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html. The ISO version is not on version 4th, but on version 3rd.


> If the ODF was very clear, calligra and MSO would show it the same way as LO
> currently shows it.

ODF 1.1 does not have such clear description, therefore applications have varied in the implementation. As LO claims to support ODF1.2, it should follow the standard.


> LO doesnt seem to follow this, as it doesnt alter the minimum square to the
> minimum width or height, as seen in the attached screenshot. It keeps the
> square as large as the maximum value of either the width or height.

You are right. LO does not render it as specified.
Comment 4 QA Administrators 2016-11-08 10:34:58 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2019-12-03 14:48:37 UTC Comment hidden (obsolete)
Comment 6 Regina Henschel 2019-12-03 15:44:18 UTC
Tested with Version: 6.5.0.0.alpha0+ (x64)
Build ID: 800b6f095f95ccfb8a7ba9755292332bf97f97ad
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded

Problems still not solved:
1. Wrong name in the English UI. File format draw:style="square" should be named "square" in the UI, and file format draw:style="rectangular" should be named "rectangular" in the UI.
2. The gradient with file format draw:style="square" is not drawn as specified in ODF 1.2.
3. The gradient with file format draw:style="square" is drawn different in edit mode and presentation mode.