diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2006-04-05 03:09:15 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2006-04-05 03:09:15 +0000 |
| commit | 0dc3be291679ef96980e8dbc75d4332419695cba (patch) | |
| tree | a64571e8313f1c6ae6227b98502792043cb4427c /src/style.cpp | |
| parent | Updated cases for attributes added in <color-profile> support (diff) | |
| download | inkscape-0dc3be291679ef96980e8dbc75d4332419695cba.tar.gz inkscape-0dc3be291679ef96980e8dbc75d4332419695cba.zip | |
Moving out icc parser
(bzr r424)
Diffstat (limited to 'src/style.cpp')
| -rw-r--r-- | src/style.cpp | 34 |
1 files changed, 4 insertions, 30 deletions
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 <errno.h> + 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; } |
