summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3735add)
raw | patch | inline | side by side (parent: 3735add)
author | joncruz <joncruz@users.sourceforge.net> | |
Sun, 27 Sep 2009 04:19:01 +0000 (04:19 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Sun, 27 Sep 2009 04:19:01 +0000 (04:19 +0000) |
src/svg/svg-color-test.h | patch | blob | history | |
src/svg/svg-color.cpp | patch | blob | history | |
src/ui/dialog/document-properties.cpp | patch | blob | history |
index 49af63a5d2eba4d4c19c6a96d35a3769dd357da6..a540d4b1b5dfa2c9397b79a2ca6255ee387bfcd1 100644 (file)
--- a/src/svg/svg-color-test.h
+++ b/src/svg/svg-color-test.h
{1, true, "positive", "icc-color(positive, +0.1)"},
{1, true, "negative", "icc-color(negative, -0.1)"},
{0, false, "", "icc-color(named, value)"},
+ {1, true, "hyphen-name", "icc-color(hyphen-name, 1)"},
+ {1, true, "under_name", "icc-color(under_name, 1)"},
};
for ( size_t i = 0; i < G_N_ELEMENTS(cases); i++ ) {
diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp
index 9040d6e4389ae02a900ae6338304c98ede446bdc..a8e24c311acfa4dfd099e4ff946e20ebec4b2e63 100644 (file)
--- a/src/svg/svg-color.cpp
+++ b/src/svg/svg-color.cpp
return colors;
}
-
+/*
+ * Some discussion at http://markmail.org/message/bhfvdfptt25kgtmj
+ * Allowed ASCII first characters: ':', 'A'-'Z', '_', 'a'-'z'
+ * Allowed ASCII remaining chars add: '-', '.', '0'-'9',
+ */
bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor* dest )
{
bool good = true;
@@ -484,11 +488,14 @@ bool sp_svg_read_icc_color( gchar const *str, gchar const **end_ptr, SVGICCColor
}
if ( !g_ascii_isalpha(*str)
- && ( !(0x080 & *str) ) ) {
+ && ( !(0x080 & *str) )
+ && (*str != '_')
+ && (*str != ':') ) {
// Name must start with a certain type of character
good = false;
} else {
- while ( g_ascii_isdigit(*str) || g_ascii_isalpha(*str) || (*str == '-') ) {
+ while ( g_ascii_isdigit(*str) || g_ascii_isalpha(*str)
+ || (*str == '-') || (*str == ':') || (*str == '_') || (*str == '.') ) {
if ( dest ) {
dest->colorProfile += *str;
}
index 105d220a968f84f953f0d0cbbcd88a7ff17d5374..7e31b874a71969c1f434ab1128fb881b734c5c30 100644 (file)
&& ((val < 'a') || (val > 'z'))
&& (val != '_')
&& (val != ':')) {
- str.replace(0, 1, "_");
+ str.replace(0, 1, "-");
}
for (Glib::ustring::size_type i = 1; i < str.size(); i++) {
char val = str.at(i);
&& (val != ':')
&& (val != '-')
&& (val != '.')) {
- str.replace(i, 1, "_");
+ str.replace(i, 1, "-");
}
}
}