[Mono-bugs] [Bug 79781][Nor] Changed - Control.TopLevelControl never returns null
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sun Oct 29 17:13:24 EST 2006
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 alex.olk at googlemail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=79781
--- shadow/79781 2006-10-29 16:45:19.000000000 -0500
+++ shadow/79781.tmp.23064 2006-10-29 17:13:24.000000000 -0500
@@ -1,14 +1,14 @@
Bug#: 79781
Product: Mono: Class Libraries
Version: 1.0
-OS:
+OS: unknown
OS Details:
Status: NEW
Resolution:
-Severity:
+Severity: Unknown
Priority: Normal
Component: Windows.Forms
AssignedTo: toshok at ximian.com
ReportedBy: alex.olk at googlemail.com
QAContact: mono-bugs at ximian.com
TargetMilestone: ---
@@ -55,6 +55,41 @@
----- snip win output -----
------- Additional Comments From alex.olk at googlemail.com 2006-10-29 16:45 -------
Created an attachment (id=17946)
Test case
+
+------- Additional Comments From alex.olk at googlemail.com 2006-10-29 17:13 -------
+And here is the patch that fixes it:
+
+Index: Control.cs
+===================================================================
+--- Control.cs (Revision 67092)
++++ Control.cs (Arbeitskopie)
+@@ -2451,11 +2451,21 @@
+ get {
+ Control p = this;
+
+- while (p.parent != null) {
+- p = p.parent;
++ if (this is Form) {
++ while (p.parent != null) {
++ p = p.parent;
++ }
++
++ return p;
++ } else {
++ while (true) {
++ p = p.parent;
++ if (p is Form)
++ return p;
++ if (p == null)
++ return null;
++ }
+ }
+-
+- return p;
+ }
+ }
+
+
More information about the mono-bugs
mailing list