Bug 87309

Summary: In svg import attribute value currentColor is not resolved, if color attribute is missing
Product: LibreOffice Reporter: Regina Henschel <rb.henschel>
Component: DrawAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: dennisroczek, h3734236, joni.mustonen, vsfoote, vvort, xiscofauli
Priority: medium    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Windows (All)   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=64075
Whiteboard: target:4.5.0 target:5.1.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 88278, 88277    
Attachments: color something other than black, getting white on white document so invisible

Description Regina Henschel 2014-12-14 21:05:59 UTC
Open the attachment https://bugs.freedesktop.org/attachment.cgi?id=110836 from issue 62284.
LibreOffice acts very slow and at the end, the image is empty.

Reason: The fill value currentColor is not resolved, because there exists no color attribute in the file. And in contrast to a browser environment there exist no default value from the target document or from a default css.

For a workaround write the attribute color="black" (or any other color you like)  into the outermost svg element of the file.

In case of this special file, setting black as default color in the branch "currentColor" in /core/svgio/source/svgreader/svgtools.cxx would help. But I think it should not be solved there. I suggest to set a default value for the color attribute at the outermost svg element, but that should be discussed.
Comment 1 V Stuart Foote 2014-12-16 08:39:45 UTC
Valid issue, setting new.
Comment 2 Joni_M 2015-01-10 08:22:05 UTC
You can also change black to near black like #020000.
I hope this will be corrected to LibreOffice source code, since I have couple hundred SVG pictures.
Comment 3 Commit Notification 2015-02-06 09:19:04 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d0cfd49dc530574cbbc0a95c173de8936bc9c8ca

tdf#87309: SVG - use black as default currentColor if no color was specified

It will be available in 4.5.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:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Dennis Roczek 2015-02-17 16:56:49 UTC
resolved. tested daily build win x64 bit build
Comment 5 V Stuart Foote 2015-02-19 03:27:16 UTC
Created attachment 113492 [details]
color something other than black, getting white on white document so invisible

Can we take another look at this, while we are getting a color set now. 

If File -> Open into Draw, image color is actually being set white on white background--so is invisible.  Changing the Tools -> Options -> Appearance: Document background to contrasting color shows the complete reicha.svg image is present.

See attached
Comment 6 Commit Notification 2015-11-02 11:19:02 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=25fbffcd441bd84329be2979d53f29955f55201d

tdf#87309: Use black as default currentColor if no color was...

It will be available in 5.1.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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Xisco FaulĂ­ 2015-11-02 11:53:22 UTC
Apply the same fix to File - Open. As a reference: Chrome and Firefox use black as default currentColor if no color is specified
Comment 8 Commit Notification 2015-11-02 14:31:41 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5654e8f2cfc3ae33da3eae366229b6cb862750bf

SVG: add import test for tdf#87309

It will be available in 5.1.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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

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