[Mono-bugs] [Bug 467225] New: Several bugs in TreeView and TreeNode

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jan 18 22:48:54 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=467225


           Summary: Several bugs in TreeView and TreeNode
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: djlawler at aol.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Community User


Description of Problem:

Was using the multi-select TreeView from here:
http://sourceforge.net/projects/mstreeview/.  This works fine on .net but well
on Mono at all.  I tried the standard Mono present on Ubuntu 8.10, then
compiled my own version of 2.2 for 8.10 and even tried Windows Mono version  I
finally loaded the project on Windows in Visual Studio Express and referenced
the mono SWF2k5 project and still had the following problems in the
TreeViewTest project that comes with the multi-select TreeView.

Random (but frequent) null reference exceptions when you click on nodes (or
'near' nodes).  This might be related to bug 438650.  Also, if you expand all,
select a node near the bottom, and then collapse all you get an exception. 
Also, using the arrow keys to move up or down in the treeview does not work 
Also, when you enable multi-select and use shift to select a range it not only
does not work....it goes into an infinite loop! 

Additional Information:

Here are my suggested patches to solve these issues:

For TreeNode.cs:
539,547c539
<                 // following lines added because OpenTreeNodeEnumerator
returns the node passed
<                 // to it when initialized on the first MoveNext which puts
code in multi-select
<                 // treeview into an endless loop.
<                 if (o.CurrentNode == this)
<                 {
<                     if (!o.MoveNext())
<                         return null;
<                 }
<                 TreeNode c = o.CurrentNode;
---
> 				TreeNode c = o.CurrentNode;
620,628c612
<                 // following lines added because OpenTreeNodeEnumerator
returns the node passed
<                 // to it when initialized on the first MovePrevious which
puts code in multi-select
<                 // treeview into an endless loop.
<                 if (o.CurrentNode == this)
<                 {
<                     if (!o.MovePrevious())
<                         return null;
<                 }
<                 TreeNode c = o.CurrentNode;
---
> 				TreeNode c = o.CurrentNode;

For TreeView.cs:

1379,1383c1379
<             // don't allow vbar.Value to be set to a negative
<             int temp = vbar.Maximum - VisibleCount + 1;
<             if (temp < 0)
<                 temp = 0;
<             vbar.Value = Math.Min(order, temp);
---
> 			vbar.Value = Math.Min (order, vbar.Maximum - VisibleCount + 1);
2210,2221c2206,2212
<             // lots of null checking added to avoid null Exceptions when
using
<             // multi-select Treeview
<             if (highlighted_node != null)
<                 Invalidate (highlighted_node.Bounds);
<             if (focused_node != null)
<                 Invalidate (focused_node.Bounds);
<             if (selected_node != null)
<             {
<                 Invalidate(selected_node.Bounds);
<                 highlighted_node = selected_node;
<                 focused_node = selected_node;
<             }
---
> 			Invalidate (highlighted_node.Bounds);
> 			Invalidate (selected_node.Bounds);
> 			Invalidate (focused_node.Bounds);
> 
> 			highlighted_node = selected_node;
> 			focused_node = selected_node;
>

-- 
Configure bugmail: https://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