Bug 47262 - FILEOPEN: SVG: xlink:href in radialGradient/linearGradient doesn't work if referred element hasn't been parsed yet
Summary: FILEOPEN: SVG: xlink:href in radialGradient/linearGradient doesn't work if re...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
(earliest affected)
3.3.4 release
Hardware: All All
: medium normal
Assignee: Xisco Faulí
Whiteboard: target:5.2.0
: 95652 (view as bug list)
Depends on:
Blocks: SVG-Open
  Show dependency treegraph
Reported: 2012-03-12 23:10 UTC by sasha.libreoffice
Modified: 2018-06-20 17:03 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:

test case of svg file importing (27.43 KB, image/svg+xml)
2012-03-12 23:10 UTC, sasha.libreoffice
reduced document (2.63 KB, image/svg+xml)
2015-11-10 14:39 UTC, Xisco Faulí
another sample (5.56 KB, image/svg+xml)
2015-11-16 17:16 UTC, Xisco Faulí

Note You need to log in before you can comment on or make changes to this bug.
Description sasha.libreoffice 2012-03-12 23:10:54 UTC
Created attachment 58351 [details]
test case of svg file importing

To reproduce this problem: 
0. Start LibreOffice
1. File->Open, select file vochito.svg
Expected: color gradients in picture are correct
Actually: color gradients are grey 

Reproduced in 3.3.4 and 3.5.0 on Fedora 64 bit
Comment 1 bfoman (inactive) 2012-08-09 12:06:41 UTC
Confirmed with:
Build ID: own W7 debug build
Windows 7 Professional SP1 64 bit

A lots of problems with color gradients (headlights, engine cover, wheels, backlights etc.).
Comment 2 Alexandr 2014-07-19 12:49:54 UTC
Reproducible with LibreOffice 4.2.5 and 4.3.0 on Debian x86_64.
Comment 3 V Stuart Foote 2015-01-10 19:37:23 UTC
On Windows 7 sp1, 64-bit en-US
Build ID: a3603970151a6ae2596acd62b70112f4d376b990
Locale: en_US

The SVG Insert -> Image filter renders this correctly.
The SVG fileOpen filter (Draw) does not.
Comment 4 Xisco Faulí 2015-11-10 14:39:52 UTC
Created attachment 120455 [details]
reduced document

In the reduced document the radialGradient contains a xlink:href= to #linearGradient4134" which is a linearGradient.
The problem is that the linearGradient is defined in the document after the radialGradient in the document so it fails to find it at http://opengrok.libreoffice.org/xref/core/filter/source/svg/svgreader.cxx#222 as the linearGradient hasn't been parsed yet
Comment 5 Xisco Faulí 2015-11-10 14:46:50 UTC
*** Bug 95652 has been marked as a duplicate of this bug. ***
Comment 6 Xisco Faulí 2015-11-10 14:53:57 UTC
Change summary accordingly
Comment 7 Xisco Faulí 2015-11-16 17:16:10 UTC
Created attachment 120581 [details]
another sample
Comment 8 Robinson Tryon (qubit) 2015-12-09 18:52:40 UTC Comment hidden (obsolete)
Comment 9 A (Andy) 2015-12-19 21:57:25 UTC
Reproducible with LO, Win 8.1
Comment 10 Commit Notification 2016-01-11 08:53:36 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":


tdf#47262 SVG: Parse gradient styles twice if the referred...

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.