Andreas Heppel wrote:
I have again stumbled across some strange behaviour in NSOutlineView. This time it has to do with reloading items.
The method -reloadItem:reloadChildren is using another method called _findItem:childIndex:ofParent:. I suppose that this method is intended to return the parent and the index relative to this parent of the given item. Unfortunately, it is not, as the parameter 'parent' is not by reference.
Furthermore, -reloadItem:reloadChildren does not update NSOutlineView's data structures _items and _levelOfItems, which leads to some more starnge behaviour in the case that the NSOutlineView's delegate does not simply return a changed item, but a new one. Maybe, this behaviour is intended, as the delegate is supposed to return the same, but changed item. However, fixing this is not difficult imho, thus, I'd prefer to change this behaviour. Attached is patch with a fix, containg a couple of detailed comments on what I did.

I did (hopefully) resolve this problem in a different way, by removing the helper method and inlining the code into reloadItem:reloadChildren:. This allowed for a few more corrections/simplifications (and would allow for more, if I only would understand better, what this method should do). I must admit, that NSOutlineView is a part of GUI, where I don't understand most of the code. No idea, for example, why it replaces the item with NULL, if it is nil.


Perhaps you may want to take over the maintainance this class?

Fred



_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep

Reply via email to