From 32ee59dbd78b91513523c995e356234b67792bf4 Mon Sep 17 00:00:00 2001 From: joncruz Date: Mon, 3 Apr 2006 08:43:23 +0000 Subject: [PATCH] initial parsing of icc-color() --- src/style.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/style.cpp b/src/style.cpp index 3693c5d2b..20ae8fa93 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -2914,7 +2914,38 @@ sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocume ++str; } if (strneq(str, "icc-color(", 10)) { - /* fixme: Parse icc-color to paint->iccColor here. */ + str += 10; + + SVGICCColor* tmp = new SVGICCColor(); + while ( *str && *str != ' ' && *str!= ',' && *str != ')' ) { + tmp->colorProfile += *str++; + } + while ( g_ascii_isspace(*str) || *str == ',' ) { + ++str; + } + + while ( *str && *str != ')' ) { + if ( g_ascii_isdigit(*str) || *str == '.' ) { + gchar* endPtr = 0; + gdouble dbl = g_ascii_strtod( str, &endPtr ); + if ( !errno ) { + tmp->colors.push_back( dbl ); + str = endPtr; + } else { + delete tmp; + tmp = 0; + break; + } + + while ( tmp && g_ascii_isspace(*str) || *str == ',' ) { + ++str; + } + } else { + break; + } + + } + paint->iccColor = tmp; } } } -- 2.30.2