summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2019-02-22 09:21:46 +0100
committerMartin Robinson <mrobinson@igalia.com>2019-03-05 14:37:07 +0100
commit951b1e9b9fd47e3b36c0bd43f0d7782e9dc0eb1a (patch)
treee859811763a244edc3dea66e7c6b5cd508d83022
parentcdcd153a42de410f6cfecd444a6a0f46f6197b39 (diff)
downloadatk-951b1e9b9fd47e3b36c0bd43f0d7782e9dc0eb1a.tar.gz
Fix failure value for atk_text_get_caret_offset
atk_text_get_caret_offset should return -1 if the caret is not located within the element or for other failures. This will allow clients to distinguish between a failure and when the caret is at offset 0.
-rw-r--r--atk/atktext.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/atk/atktext.c b/atk/atktext.c
index f10885d..a974cd5 100644
--- a/atk/atktext.c
+++ b/atk/atktext.c
@@ -636,7 +636,7 @@ gchar* atk_text_get_string_at_offset (AtkText *text,
*
* Gets the offset of the position of the caret (cursor).
*
- * Returns: the character offset of the position of the caret or 0 if
+ * Returns: the character offset of the position of the caret or -1 if
* the caret is not located inside the element or in the case of
* any other failure.
**/
@@ -652,7 +652,7 @@ atk_text_get_caret_offset (AtkText *text)
if (iface->get_caret_offset)
return (*(iface->get_caret_offset)) (text);
else
- return 0;
+ return -1;
}
/**