g_assert (d);
g_assert (PSPPIRE_IS_DICT (d));
- if (! dict_id_is_valid (d->dict, name, false))
+ if (! dict_id_is_valid (d->dict, name))
return FALSE;
if (idx < dict_get_n_vars (d->dict))
/* Return true if NAME would be a valid name of a variable to add to the
dictionary. False otherwise.
- If REPORT is true, then invalid names will be reported as such as errors
*/
gboolean
psppire_dict_check_name (const PsppireDict *dict,
- const gchar *name, gboolean report)
+ const gchar *name)
{
- if (! dict_id_is_valid (dict->dict, name, report))
- return FALSE;
-
- if (psppire_dict_lookup_var (dict, name))
- {
- if (report)
- msg (ME, _("Duplicate variable name."));
- return FALSE;
- }
-
- return TRUE;
+ return (dict_id_is_valid (dict->dict, name)
+ && !psppire_dict_lookup_var (dict, name));
}
-
gint
psppire_dict_get_next_value_idx (const PsppireDict *dict)
{
return path;
}
-const struct fmt_spec *var_get_write_format (const struct variable *);
+struct fmt_spec var_get_write_format (const struct variable *);
static void
tree_model_get_value (GtkTreeModel *model, GtkTreeIter *iter,
var = iter->user_data;
- const struct fmt_spec *fs = var_get_write_format (var);
+ struct fmt_spec fs = var_get_write_format (var);
switch (column)
{
break;
case DICT_TVM_COL_WIDTH:
g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, fs->w);
+ g_value_set_int (value, fs.w);
break;
case DICT_TVM_COL_DECIMAL:
g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, fs->d);
+ g_value_set_int (value, fs.d);
break;
case DICT_TVM_COL_LABEL:
g_value_init (value, G_TYPE_STRING);
psppire_dict_rename_var (PsppireDict *dict, struct variable *v,
const gchar *name)
{
- if (! dict_id_is_valid (dict->dict, name, false))
+ if (! dict_id_is_valid (dict->dict, name))
return FALSE;
/* Make sure no other variable has this name */