[at-spi2-core] Fix some return values
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Fix some return values
- Date: Thu, 30 Dec 2010 18:31:25 +0000 (UTC)
commit a23a14c031bbf85f30ff7f3e4b0ba1d505505e1d
Author: Mike Gorse <mgorse novell com>
Date: Thu Dec 30 13:34:10 2010 -0500
Fix some return values
atspi/atspi-component.c | 8 ++++----
atspi/atspi-text.c | 13 +++++++++++--
2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c
index 31298bd..f653a28 100644
--- a/atspi/atspi-component.c
+++ b/atspi/atspi-component.c
@@ -146,7 +146,7 @@ atspi_component_get_extents (AtspiComponent *obj,
dbus_uint32_t d_ctype = ctype;
AtspiRect bbox;
- bbox.x = bbox.y = bbox.width = bbox.height = 0;
+ bbox.x = bbox.y = bbox.width = bbox.height = -1;
g_return_val_if_fail (obj != NULL, atspi_rect_copy (&bbox));
_atspi_dbus_call (obj, atspi_interface_component, "GetExtents", error, "u=>(iiii)", d_ctype, &bbox);
@@ -171,7 +171,7 @@ atspi_component_get_position (AtspiComponent *obj,
dbus_uint16_t d_ctype = ctype;
AtspiPoint ret;
- ret.x = ret.y = 0;
+ ret.x = ret.y = -1;
if (!obj)
return atspi_point_copy (&ret);
@@ -197,7 +197,7 @@ atspi_component_get_size (AtspiComponent *obj, GError **error)
dbus_int32_t d_w, d_h;
AtspiPoint ret;
- ret.x = ret.y = 0;
+ ret.x = ret.y = -1;
if (!obj)
return atspi_point_copy (&ret);
@@ -219,7 +219,7 @@ atspi_component_get_size (AtspiComponent *obj, GError **error)
AtspiComponentLayer
atspi_component_get_layer (AtspiComponent *obj, GError **error)
{
- dbus_uint32_t zlayer = 0;
+ dbus_uint32_t zlayer = -1;
_atspi_dbus_call (obj, atspi_interface_component, "GetLayer", error, "=>u", &zlayer);
diff --git a/atspi/atspi-text.c b/atspi/atspi-text.c
index 88ac10a..1044f1b 100644
--- a/atspi/atspi-text.c
+++ b/atspi/atspi-text.c
@@ -102,13 +102,16 @@ atspi_text_get_text (AtspiText *obj,
gint end_offset,
GError **error)
{
- gchar *retval;
+ gchar *retval = NULL;
dbus_int32_t d_start_offset = start_offset, d_end_offset = end_offset;
- g_return_val_if_fail (obj != NULL, NULL);
+ g_return_val_if_fail (obj != NULL, g_strdup (""));
_atspi_dbus_call (obj, atspi_interface_text, "GetText", error, "ii=>s", start_offset, end_offset, &retval);
+ if (!retval)
+ retval = g_strdup ("");
+
return retval;
}
@@ -356,6 +359,8 @@ atspi_text_get_text_before_offset (AtspiText *obj,
range->start_offset = d_start_offset;
range->end_offset = d_end_offset;
+ if (!range->content)
+ range->content = g_strdup ("");
return range;
}
@@ -397,6 +402,8 @@ atspi_text_get_text_at_offset (AtspiText *obj,
range->start_offset = d_start_offset;
range->end_offset = d_end_offset;
+ if (!range->content)
+ range->content = g_strdup ("");
return range;
}
@@ -439,6 +446,8 @@ atspi_text_get_text_after_offset (AtspiText *obj,
range->start_offset = d_start_offset;
range->end_offset = d_end_offset;
+ if (!range->content)
+ range->content = g_strdup ("");
return range;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]