+2008-12-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * MaskedTextBox.cs: MaskedTextService.Replace doesn't expect the
+ length of the text, but the end position, so we need to substract 1 to
+ have a valid value. Also, in the same InputText method, don't use
+ SelectionLength as the length of the text, since the selected text
+ could actually be empty, but we need to set the value anyway.
+ Fixes #457370.
+
2008-12-10 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* TextBox.cs: Don't do any auto complete task if the custom source is
if (RejectInputOnFirstFailure) {
if (overwrite) {
- provider.Replace (input, SelectionStart, SelectionStart + SelectionLength, out testPosition, out resultHint);
+ provider.Replace (input, SelectionStart, SelectionStart + input.Length - 1, out testPosition, out resultHint);
} else {
provider.InsertAt (input, SelectionStart);
}
} else {
while (!result && input.Length > 0) {
if (overwrite) {
- result = provider.Replace (input, SelectionStart, SelectionStart + input.Length, out testPosition, out resultHint);
+ result = provider.Replace (input, SelectionStart, SelectionStart + input.Length - 1, out testPosition, out resultHint);
} else {
result = provider.InsertAt (input, SelectionStart, out testPosition, out resultHint);
}