returning arrays from plugins



Hi

I am testing and improving the gda plugin, and found out that now, in
the GNOME 2 version, only the first column of the first row of the
dataset returned is displayed in the sheet (after I pressed
SHIFT-ENTER).

The code to create and return the array is:

        array = value_new_array_empty (fieldcount, rowcount);
        for (row = 0; row < rowcount; row++) {
                for (col = 0; col < fieldcount; col++) {
                        gchar *str;
                        const GdaValue *value;

                        value = gda_data_model_get_value_at (GDA_DATA_MODEL (recset),
                                                             col, row);
                        str = gda_value_stringify ((GdaValue *) value);
                        value_array_set (array,
                                         col,
                                         row,
                                         value_new_string(str));

                        g_free (str);
                }
        }

is that still the way to do it in the GNOME 2 version?

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]