Menu

#112 Don't shuffle tag list sequence

open
5
2002-07-29
2002-07-29
No

Canvas should not shuffle the tag list sequence (on
which I'm relying to retrieve "dynamic option"
parameters) in dtag.

Current code:

for (i = itemPtr->numTags-1; i >= 0; i--) {
if (itemPtr->tagPtr[i] == tag) {
itemPtr->tagPtr[i] = itemPtr->tagPtr[itemPtr->numTags-1];
itemPtr->numTags--;
}
}

Rather, it should use memmove to delete the tag.

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-08-08

    Logged In: YES
    user_id=72656

    Isn't this irrelevant? Aren't tags always returned in priority
    order?

     
  • Sebastian Wangnick

    Logged In: YES
    user_id=202812

    Hey, this is the canvas, not TkTable ;)

    When I itemconfigure -tags to a certain list, I don't expect this
    list to be shuffled behind my back. Also, I can gain some
    performance by lsearch-ing the tag list with -exact to lookup
    a "marker" tag, and then retrieve data attached to the canvas
    item from the next list element.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.