https://bugzilla.novell.com/show_bug.cgi?id=362112
Summary: PropertyGrid: blank Char property field contains a null
char
Product: Mono: Class Libraries
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Windows.Forms
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
Created an attachment (id=195102)
--> (https://bugzilla.novell.com/attachment.cgi?id=195102)
Repro code
When editing an uninitialised Char property the text field initially contains a
(generally invisible!) null character. The field should be empty in that case.
To repro, run the attached code which has a property of type char, click in it
and type 'a' (without the quotes), confirm the edit (hit return, etc), and see
error "...value 'a ' is not...", note the two chars in the quotes. (On some
systems the null character is visible as a square etc).
This is actually a flaw in the CharTypeConverter, see the test case below which
passes on MSFT:
[Test]
public void NullChar()
{
TypeConverter tc = new CharConverter ();
Char input = (char)0;
String str = (String)tc.ConvertTo (input, typeof (String));
Assert.IsNotNull (str, "1-not null");
Assert.AreEqual (0, str.Length, "2-empty");
}
--
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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs