[Mono-bugs] [Bug 601789] Sorted TreeView.Nodes.Add(Node) should return the added node index, not the total node count

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun May 2 17:00:46 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=601789

http://bugzilla.novell.com/show_bug.cgi?id=601789#c2


--- Comment #2 from Thomas Goldstein <stifu at free.fr> 2010-05-02 21:00:45 UTC ---
Created an attachment (id=358466)
 --> (http://bugzilla.novell.com/attachment.cgi?id=358466)
Bonus patch

This is a bonus patch for something unrelated in the same class.
It just simplifies a needlessly complex condition, which had redundant bits and
didn't make much sense. I thought I wouldn't merge both patches to make
reviewing easier.

Before:

            if (owner != null && tree_view != null && (owner.IsExpanded ||
owner.IsRoot)) {
                 tree_view.UpdateBelow (owner);
            } else if (owner != null && tree_view != null) {
                tree_view.UpdateBelow (owner);
            }

After:

            if (tree_view != null)
                tree_view.UpdateBelow (owner);


If tree_view != null, then owner != null (tree_view remains null if owner is
null), so no need to check that owner is not null (which is just what's done
just above in the same method). As for the remaining conditions,
"(owner.IsExpanded || owner.IsRoot)", that part is useless due to the else just
below, so UpdateBelow will be called regardless of the value of
owner.IsExpanded and owner.IsRoot.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list