Commit 05371b4a authored by peregrine's avatar peregrine Committed by Bryce Harrington
Browse files

Color names have additional numbers.

Fixed bugs:
  - https://launchpad.net/bugs/1658320

(bzr r15494)
(cherry picked from commit 528e1e0c

)
Signed-off-by: su-v's avatarsu-v <suv-sf@users.sf.net>
parent 30f66095
......@@ -375,9 +375,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;
}
......@@ -398,7 +398,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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment