[Mono-bugs] [Bug 624915] New: calling ExpandAll() on a TreeView contain in a small panel can throw ArgumentOutOfRangeException.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jul 22 20:03:50 EDT 2010


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

http://bugzilla.novell.com/show_bug.cgi?id=624915#c0


           Summary: calling ExpandAll() on a TreeView contain in a small
                    panel can throw ArgumentOutOfRangeException.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: tom_hindle at sil.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=377907)
 --> (http://bugzilla.novell.com/attachment.cgi?id=377907)
Test case showing bug.

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.5
(KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5

Adding a TreeView with DockStyle.Fill to a Form with height of 50, then calling
ExpandAll() on the Tree, throws a ArgumentOutOfRangeException.

The Vertical scrollbar gets set to a negative value.


This happens in a block of code labeled:

///
/// Everything below this is basically an emulation of a strange bug on MS
/// where they don't always scroll to the last node on ExpandAll
///


So I think making this more robust might be a good way to fix it. ie. :
vbar.Value = Max(vbar.Minimim, vbar.Maximum - VisibleCount + 1)

This block of code sets vbar.Value directly in one place and indirectly via a
call to SetTop(). 




Reproducible: Always

Steps to Reproduce:
1. Compile and Run Small Test Program
2. Click button that says ClickMe
Actual Results:  
System.ArgumentOutOfRangeException: '5' is not a valid value for 'Value'.
'Value' should be between 'Minimum' and 'Maximum'
Parameter name: Value
  at System.Windows.Forms.ScrollBar.set_Value (Int32 value) [0x000d5] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollBar.cs:642 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.ScrollBar:set_Value (int)
  at System.Windows.Forms.TreeView.ExpandAll () [0x000be] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs:793 
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.TreeView:ExpandAll ()
  at TreeViewTest.MainClass.HandleBClick (System.Object sender,
System.EventArgs e) [0x00000] in
/home/hindlet/Projects/TreeViewTest/TreeViewTest/TreeViewTest.cs:39 
  at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x0001c] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:6019 
  at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00024] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Button.cs:106 
  at System.Windows.Forms.ButtonBase.OnMouseUp
(System.Windows.Forms.MouseEventArgs mevent) [0x00081] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs:634 
  at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs
mevent) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Button.cs:128 
  at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m)
[0x0007e] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5580 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x0017b] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:5317 
  at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m)
[0x00054] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs:696 
  at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m)
[0x00000] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Button.cs:150 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:234 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs:215 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00085] in
/home/hindlet/src/custom-mono/mcs/class/Managed.Windows.Forms/System.Windows.Forms/NativeWindow.cs:242

Expected Results:  
ArgumentOutOfRangeException should not be thrown.

-- 
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