Commit 6d66ce2f authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Rearrange the code a bit.

2006-04-12  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkkeys-x11.c (gdk_keymap_get_entries_for_keycode):
	Rearrange the code a bit.
parent 374c8554
2006-04-12 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkkeys-x11.c (gdk_keymap_get_entries_for_keycode):
Rearrange the code a bit.
* gtk/gtktextlayout.c (gtk_text_layout_validate_yrange):
Handle _gtk_text_line_get_data() returning NULL in all
cases. (Coverity)
......
2006-04-12 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkkeys-x11.c (gdk_keymap_get_entries_for_keycode):
Rearrange the code a bit.
* gtk/gtktextlayout.c (gtk_text_layout_validate_yrange):
Handle _gtk_text_line_get_data() returning NULL in all
cases. (Coverity)
......
......@@ -1015,37 +1015,21 @@ gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
++i;
}
}
if ((key_array && key_array->len > 0) ||
(keyval_array && keyval_array->len > 0))
{
if (keys)
*keys = (GdkKeymapKey*) key_array->data;
if (keyvals)
*keyvals = (guint*) keyval_array->data;
*n_entries = 0;
if (key_array)
*n_entries = key_array->len;
else
*n_entries = keyval_array->len;
if (keys)
{
*n_entries = key_array->len;
*keys = (GdkKeymapKey*) g_array_free (key_array, FALSE);
}
else
if (keyvals)
{
if (keys)
*keys = NULL;
if (keyvals)
*keyvals = NULL;
*n_entries = 0;
*n_entries = keyval_array->len;
*keyvals = (guint*) g_array_free (keyval_array, FALSE);
}
if (key_array)
g_array_free (key_array, key_array->len > 0 ? FALSE : TRUE);
if (keyval_array)
g_array_free (keyval_array, keyval_array->len > 0 ? FALSE : TRUE);
return *n_entries > 0;
}
......
Markdown is supported
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