Fixes SVACE issue with thread-unsafe calls to strerror
[platform/upstream/at-spi2-core.git] / atspi / atspi-text.c
index 67510ea..1e887d3 100644 (file)
@@ -138,7 +138,7 @@ atspi_text_get_caret_offset (AtspiText *obj, GError **error)
 }
 
 /**
- * atspi_text_get_attributes:
+ * atspi_text_get_attributes: (rename-to atspi_text_get_text_attributes)
  * @obj: a pointer to the #AtspiText object to query.
  * @offset: a #gint indicating the offset from which the attribute
  *        search is based.
@@ -156,7 +156,6 @@ atspi_text_get_caret_offset (AtspiText *obj, GError **error)
  * describing the attributes at the given character offset.
  *
  * Deprecated: 2.10: Use atspi_text_get_text_attributes instead.
- * Rename to: atspi_text_get_text_attributes
  **/
 GHashTable *
 atspi_text_get_attributes (AtspiText *obj,
@@ -280,18 +279,17 @@ atspi_text_get_attribute_run (AtspiText *obj,
 }
 
 /**
- * atspi_text_get_attribute_value:
+ * atspi_text_get_attribute_value: (rename-to atspi_text_get_text_attribute_value)
  * @obj: a pointer to the #AtspiText object to query.
  * @offset: The character offset at which to query the attribute.
  * @attribute_name: The attribute to query.
  *
  * Gets the value of a named attribute at a given offset.
  *
- * Returns: the value of a given attribute at the given offset, or NULL if
- * not present.
+ * Returns: (nullable): the value of a given attribute at the given
+ * offset, or %NULL if not present.
  *
  * Deprecated: 2.10: Use atspi_text_get_text_attribute_value instead.
- * Rename to: atspi_text_get_text_attribute_value
  **/
 gchar *
 atspi_text_get_attribute_value (AtspiText *obj,
@@ -311,7 +309,7 @@ atspi_text_get_attribute_value (AtspiText *obj,
  *
  * Gets the value of a named attribute at a given offset.
  *
- * Returns: the value of a given attribute at the given offset, or NULL if
+ * Returns: (nullable): the value of a given attribute at the given offset, or %NULL if
  * not present.
  **/
 gchar *
@@ -321,10 +319,14 @@ atspi_text_get_text_attribute_value (AtspiText *obj,
                                      GError **error)
 {
   gchar *retval = NULL;
+  dbus_int32_t d_i = offset;
 
   g_return_val_if_fail (obj != NULL, NULL);
 
-  _atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "i=>s", offset, &retval);
+  _atspi_dbus_call (obj, atspi_interface_text, "GetAttributeValue", error, "is=>s", d_i, (const gchar *)attribute_value, &retval);
+
+  if (!retval)
+    retval = g_strdup ("");
 
   return retval;
 }