Commit ba14b9fc authored by Samuel Thibault's avatar Samuel Thibault
Browse files

Make sure returned values are initialized

Some methods do not have a way to notify that they have failed.
They should thus make sure that they set some value, rather than let them
uninitialized and thus random.

This is a follow-up for 9118d447 ("Make sure returned values are
initialized")
parent d7ba8796
......@@ -97,6 +97,9 @@ atk_image_get_image_description (AtkImage *image)
* Get the width and height in pixels for the specified image.
* The values of @width and @height are returned as -1 if the
* values cannot be obtained (for instance, if the object is not onscreen).
*
* If the size can not be obtained (e.g. missing support), x and y are set
* to -1.
**/
void
atk_image_get_image_size (AtkImage *image,
......@@ -171,6 +174,9 @@ atk_image_set_image_description (AtkImage *image,
*
* Gets the position of the image in the form of a point specifying the
* images top-left corner.
*
* If the position can not be obtained (e.g. missing support), x and y are set
* to -1.
**/
void
atk_image_get_image_position (AtkImage *image,
......
......@@ -665,6 +665,9 @@ atk_text_get_caret_offset (AtkText *text)
* @height: (out) (optional): Pointer for the height of the bounding box
* @coords: specify whether coordinates are relative to the screen or widget window
*
* If the extent can not be obtained (e.g. missing support), all of x, y, width,
* height are set to -1.
*
* Get the bounding box containing the glyph representing the character at
* a particular text offset.
**/
......@@ -700,10 +703,10 @@ atk_text_get_character_extents (AtkText *text,
else
real_height = &local_height;
*real_x = 0;
*real_y = 0;
*real_width = 0;
*real_height = 0;
*real_x = -1;
*real_y = -1;
*real_width = -1;
*real_height = -1;
if (offset < 0)
return;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment