From 0dc3be291679ef96980e8dbc75d4332419695cba Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 5 Apr 2006 03:09:15 +0000 Subject: Moving out icc parser (bzr r424) --- src/style.cpp | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) (limited to 'src/style.cpp') diff --git a/src/style.cpp b/src/style.cpp index 230d8f466..2a0a30bd1 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -40,7 +40,7 @@ #include "xml/repr.h" #include "unit-constants.h" #include "isnan.h" -#include + using Inkscape::CSSOStringStream; using std::vector; @@ -2915,36 +2915,10 @@ sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocume ++str; } if (strneq(str, "icc-color(", 10)) { - 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; - } - + if ( ! sp_svg_read_icc_color( str, &str, tmp ) ) { + delete tmp; + tmp = 0; } paint->iccColor = tmp; } -- cgit v1.2.3