
Hi, all,
After digging around the code looking for a particular bug, I was struck by the fact that although Inkscape went through the "c++ification" process almost 2 years ago, a great many of the classes are still merely wrappers of the legacy code. One thing I noticed in particular was that char *'s are still used in most of the code for the storage of file names and xml string data.
Wouldn't this cycle be a good time to convert these to Glib::ustring? We would get at least three benefits: 1) A uniform container and set of methods for Unicode data 2) Greater pointer safety if we can avoid countless explicit alloc/frees. 3) It would be harder to go out of bounds, since the string carries its size. And if you do, it is an exception, not a malloc or stack corruption.
I'm not talking about the GC'd stuff, but those so frequent snips of code like this:
if (uri) g_free(uri); uri = g_strdup(newuri);
In addition, shouldn't a document's "DocumentBase" uri (and resources it references) be a real W3C URI, or even an IRI? That way we can get a consistent method for referring to things, rather than always calculating paths explicitly all over the code tree.
Just a suggestion! :)
bob