gtkhtml r9113 - trunk/gtkhtml



Author: abharath
Date: Thu Jan 22 04:09:30 2009
New Revision: 9113
URL: http://svn.gnome.org/viewvc/gtkhtml?rev=9113&view=rev

Log:
2009-01-22  Bharath Acharya  <abharath novell com>

        ** Fix for bug #465432 (BNC)

        * htmlengine-edit-cut-and-paste.c (html_engine_delete): cluev end is in
        the selection. Lets handle this case just like simple delete.

        The bugzilla report:
        If you create a table and then put text into the table and then attempt
        to remove parts of that text; the text is removed to end of string.

        1) Create a 3x3 table
        2) click into a cell, and type in "This is how it deletes badly"
        3) Highlight the word "how" and then hit backspace to remove it.

        the rest of the words get deleted as well. This is not picked up by 
        Redo and the user will lose all of their text.


Modified:
   trunk/gtkhtml/ChangeLog
   trunk/gtkhtml/htmlengine-edit-cut-and-paste.c

Modified: trunk/gtkhtml/htmlengine-edit-cut-and-paste.c
==============================================================================
--- trunk/gtkhtml/htmlengine-edit-cut-and-paste.c	(original)
+++ trunk/gtkhtml/htmlengine-edit-cut-and-paste.c	Thu Jan 22 04:09:30 2009
@@ -1902,9 +1902,18 @@
 					}
 				} while (prev && prev->parent->next && (cur = html_object_head (prev->parent->next)));
 
-				if (prev)
-				        /* cluev end is in the selection */
-					delete_upto (e, &start, &end, prev, html_object_get_length (prev));
+				if (prev) {
+				        /* cluev end is in the selection. Lets handle this case just like simple delete 
+					since text is the selection itself*/
+					if (e->mark)
+						html_cursor_destroy (e->mark);
+					html_cursor_destroy (e->cursor);
+					e->mark = start;
+					e->cursor = end;
+					start = end = NULL;
+					delete_object (e, NULL, NULL, HTML_UNDO_UNDO, TRUE);
+					break;
+				}
 			}
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]