projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in oneway /descriptives subcommand vs. weights.
[pspp]
/
src
/
ui
/
gui
/
dict-display.c
diff --git
a/src/ui/gui/dict-display.c
b/src/ui/gui/dict-display.c
index d6b1bcd58c3b60bc5bb17705da7c18c4121d4105..ada7fb40fcbd5ab45ad55edca1c5508c5a4c8c07 100644
(file)
--- a/
src/ui/gui/dict-display.c
+++ b/
src/ui/gui/dict-display.c
@@
-23,6
+23,7
@@
#include "dict-display.h"
#include "psppire-dict.h"
#include "dict-display.h"
#include "psppire-dict.h"
+#include "psppire-var-view.h"
#include <libpspp/i18n.h>
#include "helper.h"
#include <data/variable.h>
#include <libpspp/i18n.h>
#include "helper.h"
#include <data/variable.h>
@@
-54,7
+55,6
@@
get_base_model (GtkTreeModel *top_model, GtkTreeIter *top_iter,
}
}
-
void
insert_source_row_into_entry (GtkTreeIter iter,
GtkWidget *dest,
void
insert_source_row_into_entry (GtkTreeIter iter,
GtkWidget *dest,
@@
-67,7
+67,6
@@
insert_source_row_into_entry (GtkTreeIter iter,
gint *idx;
struct variable *var;
GtkTreeIter dict_iter;
gint *idx;
struct variable *var;
GtkTreeIter dict_iter;
- gchar *name;
g_return_if_fail (GTK_IS_ENTRY(dest));
g_return_if_fail (GTK_IS_ENTRY(dest));
@@
-81,14
+80,10
@@
insert_source_row_into_entry (GtkTreeIter iter,
gtk_tree_path_free (path);
gtk_tree_path_free (path);
- name = recode_string (UTF8, psppire_dict_encoding (PSPPIRE_DICT (dict)),
- var_get_name (var), -1);
- gtk_entry_set_text (GTK_ENTRY (dest), name);
- g_free (name);
+ gtk_entry_set_text (GTK_ENTRY (dest), var_get_name (var));
}
}
-
void
insert_source_row_into_tree_view (GtkTreeIter iter,
GtkWidget *dest,
void
insert_source_row_into_tree_view (GtkTreeIter iter,
GtkWidget *dest,
@@
-100,37
+95,45
@@
insert_source_row_into_tree_view (GtkTreeIter iter,
GtkTreeIter dest_iter;
GtkTreeIter dict_iter;
gint *row ;
GtkTreeIter dest_iter;
GtkTreeIter dict_iter;
gint *row ;
- GtkTreeModel *destmodel = gtk_tree_view_get_model (
GTK_TREE_VIEW (dest));
+ GtkTreeModel *destmodel = gtk_tree_view_get_model (GTK_TREE_VIEW (dest));
+ const struct variable *var;
GtkTreeModel *dict;
GtkTreeModel *dict;
-
get_base_model (model, &iter, &dict, &dict_iter);
path = gtk_tree_model_get_path (dict, &dict_iter);
row = gtk_tree_path_get_indices (path);
get_base_model (model, &iter, &dict, &dict_iter);
path = gtk_tree_model_get_path (dict, &dict_iter);
row = gtk_tree_path_get_indices (path);
+ var = psppire_dict_get_variable (PSPPIRE_DICT (dict), *row);
+
gtk_list_store_append (GTK_LIST_STORE (destmodel), &dest_iter);
gtk_list_store_append (GTK_LIST_STORE (destmodel), &dest_iter);
- gtk_list_store_set (GTK_LIST_STORE (destmodel), &dest_iter, 0, *row, -1);
+
+ gtk_list_store_set (GTK_LIST_STORE (destmodel), &dest_iter, 0, var, -1);
gtk_tree_path_free (path);
}
gtk_tree_path_free (path);
}
+
gboolean
is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter,
PsppireSelector *selector)
{
gboolean result;
gboolean
is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter,
PsppireSelector *selector)
{
gboolean result;
- gchar *name;
GtkTreeIter dict_iter;
GtkTreeModel *dict;
struct variable *var;
gint dict_index;
gint *indeces;
GtkTreePath *path;
GtkTreeIter dict_iter;
GtkTreeModel *dict;
struct variable *var;
gint dict_index;
gint *indeces;
GtkTreePath *path;
- const gchar *text = gtk_entry_get_text (GTK_ENTRY (selector->dest));
+ GtkWidget *entry = NULL;
+ const gchar *text = NULL;
+
+ g_object_get (selector, "dest-widget", &entry, NULL);
+
+ text = gtk_entry_get_text (GTK_ENTRY (entry));
get_base_model (model, iter, &dict, &dict_iter);
get_base_model (model, iter, &dict, &dict_iter);
@@
-144,13
+147,8
@@
is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter,
gtk_tree_path_free (path);
gtk_tree_path_free (path);
- name = recode_string (UTF8, psppire_dict_encoding (PSPPIRE_DICT (dict)),
- var_get_name (var), -1);
- result = ( 0 == strcmp (text, name));
- g_free (name);
+ result = ( 0 == strcmp (text, var_get_name (var) ));
return result;
}
return result;
}
-
-