From: JucaBlues Date: Fri, 14 Aug 2009 03:52:51 +0000 (+0000) Subject: a quick workaround in order to avoid some invalid names for icc profiles. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0f23378701afb8656fd1cd699600b0c9feed0ebe;p=inkscape.git a quick workaround in order to avoid some invalid names for icc profiles. A complete sanitizer should be implemented later. --- diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index bb9ab4d02..c21f64629 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -381,6 +381,17 @@ DocumentProperties::populate_available_profiles(){ _menu.show_all(); } +//this is a quick workaround: +static gchar* sanitize_name(gchar* name){ + gchar* c=name; + while (*c != '\0'){ + if (*c == ' ') *c = '-'; + if (*c == '_') *c = '-'; + c++; + } + return name; +} + void DocumentProperties::linkSelectedProfile() { @@ -396,7 +407,8 @@ DocumentProperties::linkSelectedProfile() } Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc()); Inkscape::XML::Node *cprofRepr = xml_doc->createElement("svg:color-profile"); - cprofRepr->setAttribute("name", (gchar*) _menu.get_active()->get_data("name")); +// cprofRepr->setAttribute("inkscape:name", (gchar*) _menu.get_active()->get_data("name")); + cprofRepr->setAttribute("name", sanitize_name((gchar*) _menu.get_active()->get_data("name"))); cprofRepr->setAttribute("xlink:href", (gchar*) _menu.get_active()->get_data("filepath")); // Checks whether there is a defs element. Creates it when needed