2003-01-15 Padraig O'Briain <padraig.obriain@sun.com
authorpadraigo <padraigo@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 15 Jan 2003 11:59:33 +0000 (11:59 +0000)
committerpadraigo <padraigo@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Wed, 15 Jan 2003 11:59:33 +0000 (11:59 +0000)
* libspi/text.c (impl_getBoundedRanges): Bug fix.

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@392 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
libspi/text.c

index ae54f51..96a1918 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-01-15  Padraig O'Briain <padraig.obriain@sun.com
+
+       * libspi/text.c (impl_getBoundedRanges): Bug fix.
+
 2003-01-10  Padraig O'Briain <padraig.obriain@sun.com
 
        * libspi/text.c:
index fbadd20..c2fb75a 100644 (file)
@@ -559,6 +559,7 @@ impl_getBoundedRanges(PortableServer_Servant servant,
   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_Servant servant,
   /* 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);
+  endOffset  = MAX (minLineEnd, maxLineEnd);
 
   curr_offset = startOffset;