Author: lpage
Date: 2008-02-15 17:14:49 -0500 (Fri, 15 Feb 2008)
New Revision: 95844
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
Log:
2008-02-15 Luke Page <[EMAIL PROTECTED]>
* TextBoxBase.cs, TextControl.cs, RichTextBox.cs: TextChanged fires
when Undo/Redo changes the text. Undo/Redo/Undo/Redo now works
correctly. See #359330
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2008-02-15 22:10:45 UTC (rev 95843)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2008-02-15 22:14:49 UTC (rev 95844)
@@ -1,3 +1,8 @@
+2008-02-15 Luke Page <[EMAIL PROTECTED]>
+ * TextBoxBase.cs, TextControl.cs, RichTextBox.cs: TextChanged fires
+ when Undo/Redo changes the text. Undo/Redo/Undo/Redo now works
+ correctly. See #359330
+
2008-02-15 Andreia Gaita <[EMAIL PROTECTED]>
* XplatUIX11.cs: If the handle is null when posting a message, use the
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
2008-02-15 22:10:45 UTC (rev 95843)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
2008-02-15 22:14:49 UTC (rev 95844)
@@ -1056,7 +1056,8 @@
public void Redo()
{
- document.undo.Redo ();
+ if (document.undo.Redo ())
+ OnTextChanged (EventArgs.Empty);
}
public void SaveFile(Stream data, RichTextBoxStreamType
fileType) {
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
2008-02-15 22:10:45 UTC (rev 95843)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
2008-02-15 22:14:49 UTC (rev 95844)
@@ -860,7 +860,8 @@
[MonoTODO("Deleting is classed as Typing, instead of its own
Undo event")]
public void Undo ()
{
- document.undo.Undo();
+ if (document.undo.Undo ())
+ OnTextChanged (EventArgs.Empty);
}
#if NET_2_0
@@ -1125,7 +1126,7 @@
case Keys.Z:
if (control && read_only == false) {
- Undo();
+ Undo ();
return true;
}
return false;
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
2008-02-15 22:10:45 UTC (rev 95843)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
2008-02-15 22:14:49 UTC (rev 95844)
@@ -4059,17 +4059,14 @@
redo_actions.Clear();
}
- internal void Undo ()
+ internal bool Undo ()
{
Action action;
bool user_action_finished = false;
if (undo_actions.Count == 0)
- return;
+ return false;
- // Nuke the redo queue
- redo_actions.Clear ();
-
locked = true;
do {
Line start;
@@ -4120,25 +4117,25 @@
} while (!user_action_finished && undo_actions.Count >
0);
locked = false;
+
+ return true;
}
- internal void Redo ()
+ internal bool Redo ()
{
Action action;
bool user_action_finished = false;
if (redo_actions.Count == 0)
- return;
+ return false;
- // You can't undo anything after redoing
- undo_actions.Clear ();
-
locked = true;
do {
Line start;
int start_index;
action = (Action) redo_actions.Pop ();
+ undo_actions.Push (action);
switch (action.type) {
@@ -4192,6 +4189,8 @@
} while (!user_action_finished && redo_actions.Count >
0);
locked = false;
+
+ return true;
}
#endregion // Internal Methods
@@ -4202,6 +4201,9 @@
if (locked)
return;
+ // Nuke the redo queue
+ redo_actions.Clear ();
+
Action ua = new Action ();
ua.type = ActionType.UserActionBegin;
ua.data = name;
@@ -4226,6 +4228,9 @@
if (locked)
return;
+ // Nuke the redo queue
+ redo_actions.Clear ();
+
Action a = new Action ();
// We cant simply store the string, because then
formatting would be lost
@@ -4242,6 +4247,9 @@
if (locked || str.Length == 0)
return;
+ // Nuke the redo queue
+ redo_actions.Clear ();
+
Action a = new Action ();
a.type = ActionType.InsertString;
@@ -4257,6 +4265,9 @@
if (locked)
return;
+ // Nuke the redo queue
+ redo_actions.Clear ();
+
Action a = null;
if (undo_actions.Count > 0)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches