27 |
#include "sfm-write.h" |
#include "sfm-write.h" |
28 |
#include "case.h" |
#include "case.h" |
29 |
#include "file-handle-def.h" |
#include "file-handle-def.h" |
30 |
|
#include "data-in.h" |
31 |
|
|
32 |
#define _(A) A |
#define _(A) A |
33 |
#define N_(A) A |
#define N_(A) A |
308 |
|
|
309 |
union value *value = case_data_rw (&mycase, v->fv); |
union value *value = case_data_rw (&mycase, v->fv); |
310 |
const gchar *text = gtk_sheet_cell_get_text (sheet, r, c); |
const gchar *text = gtk_sheet_cell_get_text (sheet, r, c); |
311 |
|
if ( ! text) |
312 |
|
continue; |
313 |
|
|
314 |
if ( v->type == ALPHA) |
struct data_in d_in; |
315 |
{ |
d_in.s = text; |
316 |
memset (value->s, ' ', v->width); |
d_in.e = text + strlen(text); |
317 |
|
d_in.v = value; |
318 |
if ( text) |
d_in.f1 = d_in.f2 = 0; |
319 |
{ |
d_in.format = v->write; |
320 |
memcpy(value->s, text, strlen(text)); |
d_in.flags = 0; |
321 |
} |
|
322 |
} |
data_in(&d_in); |
|
else |
|
|
{ |
|
|
g_assert(v->width == 0); |
|
|
if (text) |
|
|
value->f = atoi(text); |
|
|
else |
|
|
value->f = SYSMIS; |
|
|
} |
|
323 |
} |
} |
324 |
|
|
325 |
|
|
326 |
if ( ! sfm_write_case(writer, &mycase) ) |
if ( ! sfm_write_case(writer, &mycase) ) |
327 |
g_print("Failed to write case %d\n",r); |
g_print("Failed to write case %d\n",r); |
328 |
|
|