Commit 22fa07d5 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Report errors about integer parsing back up. (#452988)

2007-07-03  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkcelllayout.c (attributes_text_element): Report
        errors about integer parsing back up.  (#452988)

        * tests/buildertest.c: Add an extra check.


svn path=/trunk/; revision=18364
parent 34e44d63
2007-07-03 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcelllayout.c (attributes_text_element): Report
errors about integer parsing back up. (#452988)
* tests/buildertest.c: Add an extra check.
2007-07-03 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbutton.c (gtk_button_construct_child): Don't leave
......
......@@ -17,9 +17,10 @@
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <string.h>
#include <stdlib.h>
#include <config.h>
#include <errno.h>
#include "gtkcelllayout.h"
#include "gtkintl.h"
#include "gtkalias.h"
......@@ -346,12 +347,27 @@ attributes_text_element (GMarkupParseContext *context,
GError **error)
{
AttributesSubParserData *parser_data = (AttributesSubParserData*)user_data;
glong l;
gchar *endptr;
if (!parser_data->attr_name)
return;
errno = 0;
l = strtol (text, &endptr, 0);
if (errno || endptr == text)
{
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_VALUE,
"Could not parse integer `%s'",
text);
return;
}
gtk_cell_layout_add_attribute (parser_data->cell_layout,
parser_data->renderer,
parser_data->attr_name, atoi (text));
parser_data->attr_name, l);
g_free (parser_data->attr_name);
parser_data->attr_name = NULL;
}
......
......@@ -1038,6 +1038,7 @@ gboolean test_treeview_column (void)
g_return_val_if_fail (treeview, FALSE);
g_return_val_if_fail (GTK_IS_TREE_VIEW (treeview), FALSE);
column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), 0);
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), FALSE);
g_return_val_if_fail (strcmp (gtk_tree_view_column_get_title (column),
"Test") == 0, FALSE);
......
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