Re: [g-a-devel]impl_getBoundedRanges



Bill,

I have reviewed this patch and found that the change in the while statements 
from < to <= is not necessary,

Updated patch is attached.

> 
> While looking at implementing atk_text_get_bounded_ranges() I have studied 
> impl_getBoundedRanges() and have, I think, idenfitied a number of errors.
> 
> Patch attached.
> 
> OK to commit?
> 
> Padraig
? application.c.TEST
cvs server: Diffing .
Index: text.c
===================================================================
RCS file: /cvs/gnome/at-spi/libspi/text.c,v
retrieving revision 1.19
diff -u -p -r1.19 text.c
--- text.c	10 Jan 2003 14:45:53 -0000	1.19
+++ text.c	14 Jan 2003 14:32:55 -0000
@@ -559,6 +559,7 @@ impl_getBoundedRanges(PortableServer_Ser
   int curr_offset;
   gint minLineStart, minLineEnd, maxLineStart, maxLineEnd;
   long bounds_min_offset;
+  long bounds_max_offset;
 
   clip.x = x;
   clip.y = y;
@@ -568,14 +569,16 @@ impl_getBoundedRanges(PortableServer_Ser
   /* for horizontal text layouts, at least, the following check helps. */
   bounds_min_offset =  atk_text_get_offset_at_point (text, x, y, 
 						     (AtkCoordType) coordType);
+  bounds_max_offset =  atk_text_get_offset_at_point (text, x + width, y + height, 
+						     (AtkCoordType) coordType);
   atk_text_get_text_at_offset (text, bounds_min_offset, 
 			       ATK_TEXT_BOUNDARY_LINE_START,
 			       &minLineStart, &minLineEnd);
-  atk_text_get_text_at_offset (text, bounds_min_offset, 
+  atk_text_get_text_at_offset (text, bounds_max_offset, 
 			       ATK_TEXT_BOUNDARY_LINE_START,
 			       &maxLineStart, &maxLineEnd);
-  startOffset = MIN (minLineStart, maxLineStart);
-  endOffset  = MIN (minLineEnd, maxLineEnd);
+  startOffset = MIN (minLineStart, minLineEnd);
+  endOffset  = MAX (maxLineStart, maxLineEnd);
 
   curr_offset = startOffset;
 


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