/*
- * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
{
GValue *ret;
- gchar *value;
+ GValue *value;
gchar *type;
GHashTable *format;
- value = zak_form_element_get_value (element);
+ value = zak_form_element_get_value_gvalue (element);
type = zak_form_element_get_provider_type (element);
format = zak_form_element_get_format (element);
thousands_saparator = (gchar *)g_hash_table_lookup (format, "thousands_separator");
- unformatted = zak_utils_unformat_money_full (value, thousands_saparator, NULL);
+ unformatted = zak_utils_unformat_money_full (g_value_get_string (value), thousands_saparator, NULL);
if (for_where && unformatted == 0.0)
{
thousands_saparator = (gchar *)g_hash_table_lookup (format, "thousands_separator");
currency_symbol = (gchar *)g_hash_table_lookup (format, "currency_symbol");
- unformatted = zak_utils_unformat_money_full (value, thousands_saparator, currency_symbol);
+ unformatted = zak_utils_unformat_money_full (g_value_get_string (value), thousands_saparator, currency_symbol);
if (for_where && unformatted == 0.0)
{
}
else if (g_ascii_strcasecmp (type, "string") == 0)
{
- if (for_where && g_strcmp0 (g_strstrip (g_strdup (value)), "") == 0)
+ if (for_where && g_strcmp0 (g_strstrip (g_strdup (g_value_get_string (value))), "") == 0)
{
ret = gda_value_new_null ();
}
else
{
- ret = zak_utils_gvalue_new_string (value);
+ ret = zak_utils_gvalue_new_string (g_value_get_string (value));
}
}
else if (g_ascii_strcasecmp (type, "boolean") == 0)
{
- ret = zak_utils_gvalue_new_boolean (zak_utils_string_to_boolean (value));
+ ret = zak_utils_gvalue_new_boolean (zak_utils_string_to_boolean (g_value_get_string (value)));
}
else if (g_ascii_strcasecmp (type, "date") == 0)
{
gchar *datetime_format;
datetime_format = (gchar *)g_hash_table_lookup (format, "content");
- gdt = zak_utils_get_gdatetime_from_string (value, datetime_format);
+ gdt = zak_utils_get_gdatetime_from_string (g_value_get_string (value), datetime_format);
if (gdt == NULL)
{
gchar *datetime_format;
datetime_format = (gchar *)g_hash_table_lookup (format, "content");
- gdt = zak_utils_get_gdatetime_from_string (value, datetime_format);
+ gdt = zak_utils_get_gdatetime_from_string (g_value_get_string (value), datetime_format);
if (gdt == NULL)
{
gchar *datetime_format;
datetime_format = (gchar *)g_hash_table_lookup (format, "content");
- gdt = zak_utils_get_gdatetime_from_string (value, datetime_format);
+ gdt = zak_utils_get_gdatetime_from_string (g_value_get_string (value), datetime_format);
if (gdt == NULL)
{