summaryrefslogtreecommitdiff
path: root/atk/atkcomponent.c
diff options
context:
space:
mode:
authorPadraig O'Briain <padraigo@src.gnome.org>2001-08-17 14:34:21 +0000
committerPadraig O'Briain <padraigo@src.gnome.org>2001-08-17 14:34:21 +0000
commit53427e0420c3b32cea8e54dbaf4536e678e015d0 (patch)
tree0924453ff8f77c9852a6ad77cf3988abfae851f0 /atk/atkcomponent.c
parent4bd1197183c0394d3e36976fc723f5d438d5949a (diff)
downloadatk-53427e0420c3b32cea8e54dbaf4536e678e015d0.tar.gz
Change parameter names *offset to *_offset Do not crash if NULL pointers
* docs/tmpl/atktext.sgml atk/atktext.h: Change parameter names *offset to *_offset * atk/atkcomponent.c: Do not crash if NULL pointers are passed for return values * atk/atktext.c: Change parameter names *offset to *_offset Do not crash if NULL pointers are passed for return values
Diffstat (limited to 'atk/atkcomponent.c')
-rwxr-xr-xatk/atkcomponent.c57
1 files changed, 52 insertions, 5 deletions
diff --git a/atk/atkcomponent.c b/atk/atkcomponent.c
index 961a68e..dd568b8 100755
--- a/atk/atkcomponent.c
+++ b/atk/atkcomponent.c
@@ -199,12 +199,32 @@ atk_component_get_extents (AtkComponent *component,
AtkCoordType coord_type)
{
AtkComponentIface *iface = NULL;
+ gint local_x, local_y, local_width, local_height;
+ gint *real_x, *real_y, *real_width, *real_height;
+
g_return_if_fail (ATK_IS_COMPONENT (component));
+ if (x)
+ real_x = x;
+ else
+ real_x = &local_x;
+ if (y)
+ real_y = y;
+ else
+ real_y = &local_y;
+ if (width)
+ real_width = width;
+ else
+ real_width = &local_width;
+ if (height)
+ real_height = height;
+ else
+ real_height = &local_height;
+
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->get_extents)
- (iface->get_extents) (component, x, y, width, height, coord_type);
+ (iface->get_extents) (component, real_x, real_y, real_width, real_height, coord_type);
}
/**
@@ -225,18 +245,30 @@ atk_component_get_position (AtkComponent *component,
AtkCoordType coord_type)
{
AtkComponentIface *iface = NULL;
+ gint local_x, local_y;
+ gint *real_x, *real_y;
+
g_return_if_fail (ATK_IS_COMPONENT (component));
+ if (x)
+ real_x = x;
+ else
+ real_x = &local_x;
+ if (y)
+ real_y = y;
+ else
+ real_y = &local_y;
+
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->get_position)
- (iface->get_position) (component, x, y, coord_type);
+ (iface->get_position) (component, real_x, real_y, coord_type);
else
{
/*
* if this method is not overridden use the default implementation.
*/
- atk_component_real_get_position (component, x, y, coord_type);
+ atk_component_real_get_position (component, real_x, real_y, coord_type);
}
}
@@ -254,18 +286,33 @@ atk_component_get_size (AtkComponent *component,
gint *height)
{
AtkComponentIface *iface = NULL;
+ gint local_width, local_height;
+ gint *real_width, *real_height;
+
+ g_return_if_fail (ATK_IS_COMPONENT (component));
+
+ if (width)
+ real_width = width;
+ else
+ real_width = &local_width;
+ if (height)
+ real_height = height;
+ else
+ real_height = &local_height;
+
+ iface = ATK_COMPONENT_GET_IFACE (component);
g_return_if_fail (ATK_IS_COMPONENT (component));
iface = ATK_COMPONENT_GET_IFACE (component);
if (iface->get_size)
- (iface->get_size) (component, width, height);
+ (iface->get_size) (component, real_width, real_height);
else
{
/*
* if this method is not overridden use the default implementation.
*/
- atk_component_real_get_size (component, width, height);
+ atk_component_real_get_size (component, real_width, real_height);
}
}