Changing local method variables doesn't make sense.
authorAlexander Olk <aolk@mono-cvs.ximian.com>
Tue, 15 Feb 2005 18:11:12 +0000 (18:11 -0000)
committerAlexander Olk <aolk@mono-cvs.ximian.com>
Tue, 15 Feb 2005 18:11:12 +0000 (18:11 -0000)
Fixes TextBox.Width being always 100.

svn path=/trunk/mcs/; revision=40711

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

index c6eae8bfba5a5855328b666fdea6602e1b2fac3e..b62f1a8e8132652e570176ebcd52bfb3dcd667d7 100644 (file)
@@ -5,10 +5,10 @@
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -376,15 +376,15 @@ namespace System.Windows.Forms {
                        }
                }
 
-               public override string Text {\r
-                       get {\r
-                               if (document == null || document.Root == null || document.Root.text == null) {\r
-                                       return string.Empty;\r
-                               }\r
-\r
-                               if (!multiline) {\r
-                                       return document.Root.text.ToString();\r
-                               } else {\r
+               public override string Text {
+                       get {
+                               if (document == null || document.Root == null || document.Root.text == null) {
+                                       return string.Empty;
+                               }
+
+                               if (!multiline) {
+                                       return document.Root.text.ToString();
+                               } else {
                                        StringBuilder   sb;
                                        int             i;
 
@@ -395,10 +395,10 @@ namespace System.Windows.Forms {
                                        }
 
                                        return sb.ToString();
-                               }\r
-                       }\r
-\r
-                       set {\r
+                               }
+                       }
+
+                       set {
                                Line    line;
 
                                if (multiline) {
@@ -429,19 +429,19 @@ namespace System.Windows.Forms {
                                }
                                base.Text = value;
                                OnTextChanged(EventArgs.Empty);
-                       }\r
-               }\r
+                       }
+               }
 
                public virtual int TextLength {
                        get {
-                               if (document == null || document.Root == null || document.Root.text == null) {\r
-                                       return 0;\r
-                               }\r
-\r
-                               if (!multiline) {\r
-                                       return document.Root.text.Length;\r
-                               } else {\r
-                                       int     total;\r
+                               if (document == null || document.Root == null || document.Root.text == null) {
+                                       return 0;
+                               }
+
+                               if (!multiline) {
+                                       return document.Root.text.Length;
+                               } else {
+                                       int     total;
                                        int     i;
 
                                        total = 0;
@@ -450,7 +450,7 @@ namespace System.Windows.Forms {
                                        }
 
                                        return total;
-                               }\r
+                               }
                        }
                }
 
@@ -588,24 +588,24 @@ namespace System.Windows.Forms {
                        base.CreateHandle ();
                }
 
-               protected override bool IsInputKey(Keys keyData) {\r
-                       switch (keyData) {\r
-                               case Keys.Enter: {\r
+               protected override bool IsInputKey(Keys keyData) {
+                       switch (keyData) {
+                               case Keys.Enter: {
                                        if (multiline && (accepts_return || ((keyData & Keys.Control) != 0))) {
                                                return true;
                                        }
                                        return false;
-                               }\r
-\r
-                               case Keys.Tab: {\r
-                                       if (accepts_tab) {\r
-                                               return true;\r
-                                       }\r
-                                       return false;\r
-                               }\r
-                       }\r
-                       return false;\r
-               }\r
+                               }
+
+                               case Keys.Tab: {
+                                       if (accepts_tab) {
+                                               return true;
+                                       }
+                                       return false;
+                               }
+                       }
+                       return false;
+               }
 
 
                protected virtual void OnAcceptsTabChanged(EventArgs e) {
@@ -678,7 +678,7 @@ namespace System.Windows.Forms {
                                if (!multiline) {
                                        if (height > PreferredHeight) {
                                                text_bounds = new Rectangle(x, y, width, height);
-                                               height = PreferredHeight;
+                                               text_bounds.Height = PreferredHeight;
                                        }
                                }
                        }
@@ -1075,21 +1075,21 @@ static int current;
                                document.SetSelectionToCaret(false);
                                document.DisplayCaret();
                        }
-               }\r
-                                                                             \r
-               private void TextBoxBase_FontOrColorChanged(object sender, EventArgs e) {\r
-                       if (!richtext) {\r
-                               Line    line;\r
-\r
-                               // Font changes apply to the whole document\r
-                               for (int i = 1; i <= document.Lines; i++) {\r
-                                       line = document.GetLine(i);\r
-                                       LineTag.FormatText(line, 1, line.text.Length, Font, ThemeEngine.Current.ResPool.GetSolidBrush(ForeColor));\r
+               }
+                                                                             
+               private void TextBoxBase_FontOrColorChanged(object sender, EventArgs e) {
+                       if (!richtext) {
+                               Line    line;
+
+                               // Font changes apply to the whole document
+                               for (int i = 1; i <= document.Lines; i++) {
+                                       line = document.GetLine(i);
+                                       LineTag.FormatText(line, 1, line.text.Length, Font, ThemeEngine.Current.ResPool.GetSolidBrush(ForeColor));
                                        document.UpdateView(line, 0);
-                               }\r
-                               // Make sure the caret height is matching the new font height\r
-                               document.AlignCaret();\r
-                       }\r
-               }\r
+                               }
+                               // Make sure the caret height is matching the new font height
+                               document.AlignCaret();
+                       }
+               }
        }
 }