Bug Hunting Session
Bug 89475 - Failure to load gradients from ods file
Summary: Failure to load gradients from ods file
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: odf
Keywords:
Depends on:
Blocks: ODF-import
  Show dependency treegraph
 
Reported: 2015-02-19 16:53 UTC by mwelinder
Modified: 2019-11-13 11:58 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file with 45-degree gradient (6.00 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-02-19 16:55 UTC, mwelinder
Details
Sample file with 45-degree gradient (6.02 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-02-19 16:55 UTC, mwelinder
Details
Sample file with 45-degree gradient (xlsx for reference) (6.74 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-02-19 16:56 UTC, mwelinder
Details
Sample file with -45-degree gradient (6.01 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-02-19 19:47 UTC, mwelinder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mwelinder 2015-02-19 16:53:39 UTC
LibreOffice 4.1.6.2 410m0(Build:2)

The to-be-attached file contains a circle with a gradient that should go
from red to yellow in the direction from upper left to lower right.

When localc loads this file, it incorrectly sees a 4 degree angle, not
a 45 degree angle.

    <draw:gradient draw:name="Gradient-0" draw:start-color="#ffff00" draw:end-color="#ff0000" draw:style="linear" draw:angle="45"/>

The ODF 1.2 language is...

18.3.1 angle
An angle, as defined in §4.1 of [SVG]. An angle is a double value that may be followed immediately by one of the following angle unit identifiers: deg (degrees), grad (gradiants) or rad (radians). If no unit identifier is specified, the value is assumed to be in degrees.
Note: OpenDocument v1.1 did not support angle specifications that contain an angle unit identifier. Angle unit identifiers should be omitted for compatibility with OpenDocument v1.1.

Changing the "45" to "45deg" causes LO to act as-if "0" was requested.
Comment 1 mwelinder 2015-02-19 16:55:12 UTC
Created attachment 113509 [details]
Sample file with 45-degree gradient

This file uses

draw:angle="45"
Comment 2 mwelinder 2015-02-19 16:55:47 UTC
Created attachment 113510 [details]
Sample file with 45-degree gradient

This file uses

draw:angle="45deg"
Comment 3 mwelinder 2015-02-19 16:56:27 UTC
Created attachment 113511 [details]
Sample file with 45-degree gradient (xlsx for reference)
Comment 4 mwelinder 2015-02-19 19:47:00 UTC
Created attachment 113523 [details]
Sample file with -45-degree gradient

On further investigation it looks like negative angles like "-45"
are ignored.  -45 degrees is a perfectly reasonable angle and the
spec doesn't appear to rule it out.

LO should not ignore, but normalize into whatever representation it
prefers internally.
Comment 5 Buovjaga 2015-02-25 08:56:00 UTC
Reproduced.

Additional note: .xlsx has no gradient, but a solid red fill.

Win 7 Pro 64-bit, LibO Version: 4.4.0.3
Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7
Locale: fi_FI
Comment 6 tommy27 2016-04-16 07:29:13 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2017-05-22 13:27:55 UTC Comment hidden (obsolete)
Comment 8 Michael Stahl (CIB) 2019-11-13 11:58:49 UTC
note to self: import with explicit unit should work since LO 4.4; investigate how to proceed with:

commit aadda5d17f6e422da143ea774f759bfc5f629c5b
Author:     Michael Stahl <mstahl@redhat.com>
AuthorDate: Fri Oct 9 17:51:50 2015 +0200
Commit:     Michael Stahl <mstahl@redhat.com>
CommitDate: Fri Oct 9 18:03:49 2015 +0200

    xmloff: fix ODF import of gradient draw:angle attribute a bit
    
    ODF 1.2 part 3, 18.3.1 angle, says "An angle, as defined in §4.1 of
    [SVG]" and "If no unit identifier is specified, the value is assumed to
    be in degrees."
    
    Unfortunately OOo could only read and write 10th of degree here.
    
    See also https://issues.oasis-open.org/browse/OFFICE-3774
    
    As the first step towards fixing that, implement the import for
    draw:angle values with an angle unit identifier, but leave the import
    as-is if the angle identifier is missing.