summaryrefslogtreecommitdiffstats
path: root/src/id-clash.cpp
diff options
context:
space:
mode:
authorperegrine <andrej1741@yandex.ru>2017-02-08 05:29:21 +0000
committerJazzyNico <nicoduf@yahoo.fr>2017-02-08 05:29:21 +0000
commit528e1e0c53da088889b4108b1ffb6173a520c96f (patch)
tree658819d837dcb9274dbc1b262618b0045f945bbc /src/id-clash.cpp
parentfix two memory leaks (diff)
downloadinkscape-528e1e0c53da088889b4108b1ffb6173a520c96f.tar.gz
inkscape-528e1e0c53da088889b4108b1ffb6173a520c96f.zip
[Bug #1658320] Color names have additional numbers.
Fixed bugs: - https://launchpad.net/bugs/1658320 (bzr r15494)
Diffstat (limited to '')
-rw-r--r--src/id-clash.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/id-clash.cpp b/src/id-clash.cpp
index c284843b8..162cb9e89 100644
--- a/src/id-clash.cpp
+++ b/src/id-clash.cpp
@@ -373,9 +373,9 @@ void rename_id(SPObject *elem, Glib::ustring const &new_name)
gchar *id = g_strdup(new_name.c_str()); //id is not empty here as new_name is check to be not empty
g_strcanon (id, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.:", '_');
Glib::ustring new_name2 = id; //will not fail as id can not be NULL, see length check on new_name
- g_free (id);
if (!isalnum (new_name2[0])) {
g_message("Invalid Id, will not change.");
+ g_free (id);
return;
}
@@ -396,7 +396,7 @@ void rename_id(SPObject *elem, Glib::ustring const &new_name)
break;
}
}
-
+ g_free (id);
// Change to the new ID
elem->getRepr()->setAttribute("id", new_name2);
// Make a note of this change, if we need to fix up refs to it