[Mono-bugs] [Bug 48593][Wis] New - FontInfo bug (Fix is provided)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 18 Sep 2003 05:00:10 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by yaronsh@mainsoft.com.

http://bugzilla.ximian.com/show_bug.cgi?id=48593

--- shadow/48593	2003-09-18 05:00:10.000000000 -0400
+++ shadow/48593.tmp.13954	2003-09-18 05:00:10.000000000 -0400
@@ -0,0 +1,72 @@
+Bug#: 48593
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: yaronsh@mainsoft.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: FontInfo bug (Fix is provided)
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+When FontInfo wasn't modify, the property Name leads into crush. 
+
+Steps to reproduce the problem:
+1. Open the attached aspx
+2. Click the button "Test"
+
+Actual Results:
+"Array index is out of range" exception.
+
+Expected Results:
+All the button's properties has to be displayed in the list box.
+
+How often does this happen? 
+Always.
+
+Additional Information: (Diff with a fix is provided!)
+Testcase:
+=========
+<%@ Page language="c#" AutoEventWireup="false" %>
+<%@ Import Namespace="System.Reflection" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<HTML>
+     <HEAD>
+     <script runat=server language=C#>
+     private void BtnTest_Click(object sender, System.EventArgs e)
+     {
+	PropertyInfo [] properties = BtnTest.GetType().GetProperties
+                  (BindingFlags.Instance | BindingFlags.Public | 
+                   BindingFlags.NonPublic);
+	foreach(PropertyInfo property in properties)
+	{
+	     object val = property.GetValue(BtnTest, null);
+	     string valStr =( val == null ? "null" : val.ToString() );
+	     if(valStr.Length == 0) valStr = "Not Set";
+	     ListBox1.Items.Add(string.Format("{0} = {1}", property.Name, 
+                                valStr) );
+	}
+
+	ListBox1.SelectedIndex = ListBox1.Items.Count - 1;
+     }
+     </script>
+     </HEAD>
+     <body>
+	<form id="Form1" method="post" runat="server">
+	    <asp:ListBox id="ListBox1" runat="server" 
+                         Width="280px"></asp:ListBox>
+	    <asp:Button id="BtnTest" OnClick="BtnTest_Click" 
+                 runat="server" Text="Test"></asp:Button>
+	</form>
+     </body>
+</HTML>