Before I did some other changes that would require adding a new verb, I setup a unit test on verbs explicitly. In doing so, I discovered that Verb::getbyid() fails if the id has any dots in it.
To see the problem, just update and do a 'make check'. You should then see the warning come up for that (I made it a warning for the moment, instead of a failure).
So, does anyone have ideas about this and how to fix it?
On 4/28/06, Jon A. Cruz <jon@...18...> wrote:
Before I did some other changes that would require adding a new verb, I setup a unit test on verbs explicitly. In doing so, I discovered that Verb::getbyid() fails if the id has any dots in it.
Dunno about verbs, but I fixed this exact bug in SVG id= attributes a year ago:
http://svn.sourceforge.net/viewcvs.cgi/inkscape/inkscape/trunk/src/uri-refer...
Probably the verb id code was copy/pasted from there before the fix.
-- bulia byak Inkscape. Draw Freely. http://www.inkscape.org
On Apr 28, 2006, at 11:14 AM, bulia byak wrote:
On 4/28/06, Jon A. Cruz <jon@...18...> wrote:
Before I did some other changes that would require adding a new verb, I setup a unit test on verbs explicitly. In doing so, I discovered that Verb::getbyid() fails if the id has any dots in it.
Dunno about verbs, but I fixed this exact bug in SVG id= attributes a year ago:
http://svn.sourceforge.net/viewcvs.cgi/inkscape/inkscape/trunk/src/ uri-references.cpp?r1=7023&r2=7916&sortby=date
Probably the verb id code was copy/pasted from there before the fix.
That wasn't the problem in this case.
What it turns out to be is a problem with the null checking on the std::map used to store the ids. They end up with entries with null (e.g. 0) pointers for id's to be in there twice (beginning and end). "org.inkscape.dialogs.extensioneditor" didn't fail because of its dots, but because it was the last item in the table before the null.
I can fix the comparison function, but that leaves the main problem with two verbs being added with null IDs.
Here are the guilty parties:
/* Header */ new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL), ... /* Footer */ new Verb(SP_VERB_LAST, NULL, NULL, NULL, NULL)
My current take on things is that once the comparator is fixed, SP_VERB_LAST will stomp over SP_VERB_INVALID. Is that fine, or should we tweak some magic "last" verb ID so that SP_VERB_INVALID will stay in there?
On Sat, 6 May 2006, Jon A. Cruz wrote:
What it turns out to be is a problem with the null checking on the std::map used to store the ids. They end up with entries with null (e.g. 0) pointers for id's to be in there twice (beginning and end). "org.inkscape.dialogs.extensioneditor" didn't fail because of its dots, but because it was the last item in the table before the null.
Cool. Good catch. There is a lot of NULLs in the Verbs code that are valid values (NULL documents for actions, etc.).
I can fix the comparison function, but that leaves the main problem with two verbs being added with null IDs.
Here are the guilty parties:
/* Header */ new Verb(SP_VERB_INVALID, NULL, NULL, NULL, NULL), ... /* Footer */ new Verb(SP_VERB_LAST, NULL, NULL, NULL, NULL)
My current take on things is that once the comparator is fixed, SP_VERB_LAST will stomp over SP_VERB_INVALID. Is that fine, or should we tweak some magic "last" verb ID so that SP_VERB_INVALID will stay in there?
I don't think that we need both, and I'd question whether we need either. But, both are used throughout the code. I'd say go for removing atleast one of them.
--Ted
On Fri, 2006-04-28 at 09:41 -0700, Jon A. Cruz wrote:
Before I did some other changes that would require adding a new verb, I setup a unit test on verbs explicitly. In doing so, I discovered that Verb::getbyid() fails if the id has any dots in it.
To see the problem, just update and do a 'make check'. You should then see the warning come up for that (I made it a warning for the moment, instead of a failure).
So, does anyone have ideas about this and how to fix it?
Did you figure this out? I'm a touch surprised by this as the effects all have verbs with verb IDs that have periods in them...
--Ted
participants (4)
-
unknown@example.com
-
bulia byak
-
Jon A. Cruz
-
Ted Gould