[dia] svg: set un-parsable color to none again
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] svg: set un-parsable color to none again
- Date: Sun, 21 Jul 2013 14:21:11 +0000 (UTC)
commit 3b7dd34e9065df8c689c1d4d8adc79ce90ce1779
Author: Hans Breuer <hans breuer org>
Date: Sun Jul 21 15:47:07 2013 +0200
svg: set un-parsable color to none again
instead of accidental DIA_SVG_COLOUR_DEFUALT_FILL
lib/dia_svg.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/lib/dia_svg.c b/lib/dia_svg.c
index 7c15d61..05a2614 100644
--- a/lib/dia_svg.c
+++ b/lib/dia_svg.c
@@ -416,7 +416,8 @@ dia_svg_parse_style(xmlNodePtr node, DiaSvgStyle *s, real user_scale)
while ((ptr[0] != '\0') && g_ascii_isspace(ptr[0])) ptr++;
if (ptr[0] == '\0') break;
- _parse_color (&s->stroke, ptr);
+ if (!_parse_color (&s->stroke, ptr))
+ s->stroke = DIA_SVG_COLOUR_NONE;
} else if (!strncmp("stroke-opacity:", ptr, 15)) {
ptr += 15;
s->stroke_opacity = g_ascii_strtod(ptr, &ptr);
@@ -425,7 +426,8 @@ dia_svg_parse_style(xmlNodePtr node, DiaSvgStyle *s, real user_scale)
while (ptr[0] != '\0' && g_ascii_isspace(ptr[0])) ptr++;
if (ptr[0] == '\0') break;
- _parse_color (&s->fill, ptr);
+ if (!_parse_color (&s->fill, ptr))
+ s->fill = DIA_SVG_COLOUR_NONE;
} else if (!strncmp("fill-opacity:", ptr, 13)) {
ptr += 13;
s->fill_opacity = g_ascii_strtod(ptr, &ptr);
@@ -509,7 +511,8 @@ dia_svg_parse_style(xmlNodePtr node, DiaSvgStyle *s, real user_scale)
*/
str = xmlGetProp(node, (const xmlChar *)"fill");
if (str) {
- _parse_color (&s->fill, (char *) str);
+ if (!_parse_color (&s->fill, (char *) str))
+ s->fill = DIA_SVG_COLOUR_NONE;
xmlFree(str);
}
str = xmlGetProp(node, (const xmlChar *)"fill-opacity");
@@ -519,7 +522,8 @@ dia_svg_parse_style(xmlNodePtr node, DiaSvgStyle *s, real user_scale)
}
str = xmlGetProp(node, (const xmlChar *)"stroke");
if (str) {
- _parse_color (&s->stroke, (char *) str);
+ if (!_parse_color (&s->stroke, (char *) str))
+ s->stroke = DIA_SVG_COLOUR_NONE;
xmlFree(str);
}
str = xmlGetProp(node, (const xmlChar *)"stroke-opacity");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]