[Mono-bugs] [Bug 643366] [Regression] Scrollbar: "LargeChange" System.ArgumentOutOfRangeException

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Dec 6 02:27:19 EST 2010


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

https://bugzilla.novell.com/show_bug.cgi?id=643366#c6


--- Comment #6 from Hin-Tak Leung <htl10 at users.sourceforge.net> 2010-12-06 07:27:18 UTC ---
I tried rolling back manually the 36 changes one by one between 2.8 an 2.6.7 in
mcs/class/Managed.Windows.Forms without success (rolling back everything still
gives me the error), but thanks to the cool new feature in Mono 2.8 
(http://tirania.org/blog/archive/2010/Jul-21-1.html ), doing --trace=E:all, the
ArgumentOutOfRangeException
is shown to come from:
----------------------
System.ArgumentOutOfRangeException: Value '-7' must be greater than or equal to
0.
Parameter name: LargeChange

"<unnamed thread>"  at System.Windows.Forms.ScrollBar.set_LargeChange (int)
[0x0005b] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.8.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\ScrollBar.cs:471
  at (wrapper remoting-invoke-with-check)
System.Windows.Forms.ScrollBar.set_LargeChange (int) <IL 0x00033, 0x00057>
  at System.Windows.Forms.ListView.CalculateScrollBars () [0x00331] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.8.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\ListView.cs:1488
  at System.Windows.Forms.ListView.CalculateListView
(System.Windows.Forms.ListViewAlignment) [0x000f5] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.8.1\mcs\class\Managed.Windows.Forms\System.Windows.Forms\ListView.cs:2167
------------------------

And indeed, adding a ">" check around System.Windows.Forms\ListView.cs:1488
seems to take care of the error:

---------------------------------------
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
@@ -1484,9 +1484,11 @@ namespace System.Windows.Forms
                                }

                                if (view == View.Details) {
                                        // Need to update Maximum if using
LargeChange with value other than the visible area
+                  if (v_scroll.Height > (header_control.Height +
item_size.Height)) {
                                        v_scroll.LargeChange = v_scroll.Height
- (header_control.Height + item_size.Height);
                                        v_scroll.Maximum -=
header_control.Height + item_size.Height;
+                    }
                                } else
                                        v_scroll.LargeChange = v_scroll.Height;

------------------------------------------

So the question is, whether such a check is correct or if it should be fixed in
a different way?

Also, one curious thing is that this change was introduced before 2.6.7, but
the problem did not happen until some what between 2.6.7 and 2.8 . So it
appears that it was masked by something else? As I noted earlier, copying the
2.6.7 system.windows.form dll over works, but manually rolling back all 36
changes does not.

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