Remove excessive shortcut key matching in ToolStrip
authorStephen McConnel <stephen_mcconnel@sil.org>
Wed, 1 Oct 2014 20:04:39 +0000 (15:04 -0500)
committerStephen McConnel <stephen_mcconnel@sil.org>
Wed, 1 Oct 2014 20:04:39 +0000 (15:04 -0500)
This fixes https://bugzilla.xamarin.com/show_bug.cgi?id=23532.

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs

index 30c0d89f5fb40633ee7a05e3dc555e6408b74e67..6cfe4b2ecf896bf96db3ad83bf96b18291ead7de 100644 (file)
@@ -1145,13 +1145,7 @@ namespace System.Windows.Forms
                                if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && Control.IsMnemonic (charCode, tsi.Text))
                                        return tsi.ProcessMnemonic (charCode);
 
-                       string code = Char.ToUpper (charCode).ToString ();
-                       
-                       // If any item's text starts with our letter, it gets the message
-                       if ((Control.ModifierKeys & Keys.Alt) != 0 || this is ToolStripDropDownMenu)
-                               foreach (ToolStripItem tsi in this.Items)
-                                       if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && tsi.Text.ToUpper ().StartsWith (code) && !(tsi is ToolStripControlHost))
-                                               return tsi.ProcessMnemonic (charCode);
+                       // Do not try to match any further here.  See Xamarin bug 23532.
 
                        return base.ProcessMnemonic (charCode);
                }