[evolution-patches] seek review for bug 48171:gok's word+, word- do not work well in composer



Hi Radek,

The implementation of interface atk_text_get_text_at_offset() uses the
GailTextUtil. And the GailTextUtil is initialized only when the atk 
text object is created. But the problem is that in composer text object
may change thereafter.

So when the atk text object is created, it may be only "123456789". So
the GtkTextBuffer used by GailTextUtil is also initialized to be
"123456789".  Later text is changed in composer, but GailTextUtil will
not be refreshed. Thus the problem.

My fix is just to refresh the buffer according to the text object each
time the interface is called. Please review.


Thanks
York





Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/ChangeLog,v
retrieving revision 1.5
diff -u -r1.5 ChangeLog
--- ChangeLog	1 Sep 2003 04:43:40 -0000	1.5
+++ ChangeLog	5 Sep 2003 01:46:30 -0000
@@ -1,3 +1,10 @@
+2003-09-05  Yuedong Du  <yuedong du sun com>
+
+	* text.c: (html_a11y_text_get_text_after_offset),
+	(html_a11y_text_get_text_at_offset),
+	(html_a11y_text_get_text_before_offset): re-setup string each time it
+	is required because in composer, the text content is dynamic.
+
 2003-09-01  Yuedong Du  <yuedong du sun com>
 
 	* text.c: (html_a11y_text_get_type), (atk_text_interface_init),
Index: text.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/a11y/text.c,v
retrieving revision 1.5
diff -u -r1.5 text.c
--- text.c	1 Sep 2003 04:43:40 -0000	1.5
+++ text.c	5 Sep 2003 01:46:31 -0000
@@ -365,6 +365,9 @@
 html_a11y_text_get_text_after_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type,
 				      gint *start_offset, gint *end_offset)
 {
+	HTMLText *to = HTML_TEXT (HTML_A11Y_HTML (text));
+
+	gail_text_util_text_setup (HTML_A11Y_TEXT (text)->util, to->text);
 	return gail_text_util_get_text (HTML_A11Y_TEXT (text)->util, NULL, GAIL_AFTER_OFFSET, boundary_type, offset, 
 					start_offset, end_offset);
 }
@@ -373,8 +376,13 @@
 html_a11y_text_get_text_at_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type,
 				   gint *start_offset, gint *end_offset)
 {
+	gchar * ret;
+	HTMLText *to = HTML_TEXT (HTML_A11Y_HTML (text));
+
+	gail_text_util_text_setup (HTML_A11Y_TEXT (text)->util, to->text);
 	return gail_text_util_get_text (HTML_A11Y_TEXT (text)->util, NULL, GAIL_AT_OFFSET, boundary_type, offset, 
 					start_offset, end_offset);
+	
 }
 
 static gunichar
@@ -391,6 +399,12 @@
 html_a11y_text_get_text_before_offset (AtkText *text, gint offset, AtkTextBoundary boundary_type,
 				       gint *start_offset, gint *end_offset)
 {
+	HTMLText *to = HTML_TEXT (HTML_A11Y_HTML (text));
+
+	g_return_val_if_fail (to, NULL);
+
+	gail_text_util_text_setup (HTML_A11Y_TEXT (text)->util, to->text);
+	
 	return gail_text_util_get_text (HTML_A11Y_TEXT (text)->util, NULL, GAIL_BEFORE_OFFSET, boundary_type, offset, 
 					start_offset, end_offset);
 }
@@ -476,13 +490,10 @@
                                                    gint             *width,
                                                    gint             *height,
                                                    AtkCoordType	    coords);
-  gint           (* get_character_count)          (AtkText          *text);
   gint           (* get_offset_at_point)          (AtkText          *text,
                                                    gint             x,
                                                    gint             y,
                                                    AtkCoordType	    coords);
-  gboolean       (* set_caret_offset)             (AtkText          *text,
-                                                   gint             offset);
 
 */
 


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