projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
data_out function to dynamically allocate return value.
[pspp-builds.git]
/
src
/
ui
/
gui
/
psppire-data-store.c
diff --git
a/src/ui/gui/psppire-data-store.c
b/src/ui/gui/psppire-data-store.c
index b67e27c139024308fecd33da12e0db50beb09d38..13ad0cc6cd283edfb9656a67f4eb2b3f7ae7873b 100644
(file)
--- a/
src/ui/gui/psppire-data-store.c
+++ b/
src/ui/gui/psppire-data-store.c
@@
-585,7
+585,6
@@
psppire_data_store_get_string (PsppireDataStore *store, glong row, glong column)
const struct variable *pv ;
union value v;
int width;
const struct variable *pv ;
union value v;
int width;
- GString *s;
g_return_val_if_fail (store->dict, NULL);
g_return_val_if_fail (store->datasheet, NULL);
g_return_val_if_fail (store->dict, NULL);
g_return_val_if_fail (store->datasheet, NULL);
@@
-622,21
+621,10
@@
psppire_data_store_get_string (PsppireDataStore *store, glong row, glong column)
fp = var_get_write_format (pv);
fp = var_get_write_format (pv);
- s = g_string_sized_new (fp->w + 1);
- g_string_set_size (s, fp->w);
-
- memset (s->str, 0, fp->w);
-
- g_assert (fp->w == s->len);
-
/* Converts binary value V into printable form in the exactly
FP->W character in buffer S according to format specification
FP. No null terminator is appended to the buffer. */
/* Converts binary value V into printable form in the exactly
FP->W character in buffer S according to format specification
FP. No null terminator is appended to the buffer. */
- data_out (&v, fp, s->str);
-
- text = recode_string (UTF8, psppire_dict_encoding (store->dict),
- s->str, fp->w);
- g_string_free (s, TRUE);
+ text = data_out (&v, fp);
g_strchomp (text);
g_strchomp (text);
@@
-795,7
+783,6
@@
get_row_sensitivity (const PsppireSheetModel *model, gint unit)
static gchar *
get_column_subtitle (const PsppireSheetModel *model, gint col)
{
static gchar *
get_column_subtitle (const PsppireSheetModel *model, gint col)
{
- gchar *text;
const struct variable *v ;
PsppireDataStore *ds = PSPPIRE_DATA_STORE (model);
const struct variable *v ;
PsppireDataStore *ds = PSPPIRE_DATA_STORE (model);
@@
-807,16
+794,12
@@
get_column_subtitle (const PsppireSheetModel *model, gint col)
if ( ! var_has_label (v))
return NULL;
if ( ! var_has_label (v))
return NULL;
- text = recode_string (UTF8, psppire_dict_encoding (ds->dict),
- var_get_label (v), -1);
-
- return text;
+ return xstrdup (var_get_label (v));
}
static gchar *
get_column_button_label (const PsppireSheetModel *model, gint col)
{
}
static gchar *
get_column_button_label (const PsppireSheetModel *model, gint col)
{
- gchar *text;
struct variable *pv ;
PsppireDataStore *ds = PSPPIRE_DATA_STORE (model);
struct variable *pv ;
PsppireDataStore *ds = PSPPIRE_DATA_STORE (model);
@@
-825,10
+808,7
@@
get_column_button_label (const PsppireSheetModel *model, gint col)
pv = psppire_dict_get_variable (ds->dict, col);
pv = psppire_dict_get_variable (ds->dict, col);
- text = recode_string (UTF8, psppire_dict_encoding (ds->dict),
- var_get_name (pv), -1);
-
- return text;
+ return xstrdup (var_get_name (pv));
}
static gboolean
}
static gboolean