summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--atk/atksocket.c2
-rw-r--r--atk/atksocket.h2
-rw-r--r--atk/atktext.c17
3 files changed, 19 insertions, 2 deletions
diff --git a/atk/atksocket.c b/atk/atksocket.c
index b6ca43d..887fb5c 100644
--- a/atk/atksocket.c
+++ b/atk/atksocket.c
@@ -136,7 +136,7 @@ atk_socket_new (void)
* Since: 1.30
**/
void
-atk_socket_embed (AtkSocket* obj, gchar* plug_id)
+atk_socket_embed (AtkSocket* obj, const gchar* plug_id)
{
AtkSocketClass *klass;
diff --git a/atk/atksocket.h b/atk/atksocket.h
index 54a98af..09bd0fb 100644
--- a/atk/atksocket.h
+++ b/atk/atksocket.h
@@ -62,7 +62,7 @@ struct _AtkSocketClass
ATK_AVAILABLE_IN_ALL
AtkObject* atk_socket_new (void);
ATK_AVAILABLE_IN_ALL
-void atk_socket_embed (AtkSocket* obj, gchar* plug_id);
+void atk_socket_embed (AtkSocket* obj, const gchar* plug_id);
ATK_AVAILABLE_IN_ALL
gboolean atk_socket_is_occupied (AtkSocket* obj);
diff --git a/atk/atktext.c b/atk/atktext.c
index 7b6d182..b85d93f 100644
--- a/atk/atktext.c
+++ b/atk/atktext.c
@@ -1331,6 +1331,23 @@ atk_text_rectangle_union (AtkTextRectangle *src1,
{
gint dest_x, dest_y;
+ /*
+ * Some invocations of e.g. atk_text_get_character_extents
+ * may return "-1" rectangles for character positions without support for
+ * getting an extent. In that case we have to ignore them instead of using -1
+ * values in computations.
+ */
+ if (src1->width == -1)
+ {
+ *dest = *src2;
+ return;
+ }
+ if (src2->width == -1)
+ {
+ *dest = *src1;
+ return;
+ }
+
dest_x = MIN (src1->x, src2->x);
dest_y = MIN (src1->y, src2->y);
dest->width = MAX (src1->x + src1->width, src2->x + src2->width) - dest_x;