summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2009-08-14 03:52:51 +0000
committerJucaBlues <JucaBlues@users.sourceforge.net>2009-08-14 03:52:51 +0000
commit048b095b6031adf91a6dc2fb300270f78ca44cbf (patch)
treefaac3ce6400668e91f457aba79d67a156e4ed01f /src/ui/dialog/document-properties.cpp
parentuse a function instead of copy-pasting code (diff)
downloadinkscape-048b095b6031adf91a6dc2fb300270f78ca44cbf.tar.gz
inkscape-048b095b6031adf91a6dc2fb300270f78ca44cbf.zip
a quick workaround in order to avoid some invalid names for icc profiles.
A complete sanitizer should be implemented later. (bzr r8050.1.10)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp14
1 files changed, 13 insertions, 1 deletions
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