msgstr ""
"Project-Id-Version: PSPP 0.4.2\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-07-29 13:49+0800\n"
+"POT-Creation-Date: 2006-07-30 14:13+0800\n"
"PO-Revision-Date: 2006-05-26 17:49+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: German <pspp-dev@gnu.org>\n"
msgid "All Files"
msgstr "Alle Datei"
-#: src/ui/gui/menu-actions.c:272
+#: src/ui/gui/menu-actions.c:273
msgid "Save Data As"
msgstr "Speichern unter"
-#: src/ui/gui/menu-actions.c:568
+#: src/ui/gui/menu-actions.c:582
msgid "Font Selection"
msgstr "Schriftwahlung"
msgid "Sorry. The help system hasn't yet been implemented."
msgstr "Es gibt noch nicht kein Helpsysteme. Schade!"
-#: src/ui/gui/psppire-data-store.c:699
+#: src/ui/gui/psppire-data-store.c:731
msgid "var"
msgstr ""
-#: src/ui/gui/psppire-data-store.c:780 src/ui/gui/psppire-var-store.c:518
+#: src/ui/gui/psppire-data-store.c:812 src/ui/gui/psppire-var-store.c:518
#: src/ui/gui/psppire-var-store.c:528 src/ui/gui/psppire-var-store.c:538
#: src/ui/gui/psppire-var-store.c:735
#, c-format
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2006-07-29 13:49+0800\n"
+"POT-Creation-Date: 2006-07-30 14:13+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "All Files"
msgstr ""
-#: src/ui/gui/menu-actions.c:272
+#: src/ui/gui/menu-actions.c:273
msgid "Save Data As"
msgstr ""
-#: src/ui/gui/menu-actions.c:568
+#: src/ui/gui/menu-actions.c:582
msgid "Font Selection"
msgstr ""
msgid "Sorry. The help system hasn't yet been implemented."
msgstr ""
-#: src/ui/gui/psppire-data-store.c:699
+#: src/ui/gui/psppire-data-store.c:731
msgid "var"
msgstr ""
-#: src/ui/gui/psppire-data-store.c:780 src/ui/gui/psppire-var-store.c:518
+#: src/ui/gui/psppire-data-store.c:812 src/ui/gui/psppire-var-store.c:518
#: src/ui/gui/psppire-var-store.c:528 src/ui/gui/psppire-var-store.c:538
#: src/ui/gui/psppire-var-store.c:735
#, c-format
-* Blank cell reference when deselecting cells. (Eg New command).
+* Crashes when reducing the size of string variables.
-* Strip leading/trailing whitespace on data in cells.
+* Blank cell reference when deselecting cells. (Eg New command).
* Cell Ref Entry populate/depopulate.
* Goto Variable.
-* Widen columns in var sheet as necessary to accomodate non-english translations.
-
Wishlist
========
+* Widen columns in var sheet as necessary to accomodate non-english translations.
+
* Cut/Paste Buffer. Cut and paste: a) Between psppire instances. b) From other applications.
* In datasheet, add tooltips to column buttons, so that hovering over a column button displays
extern GladeXML *xml;
-
static gboolean
traverse_callback (GtkSheet * sheet,
- gint row, gint col,
- gint *new_row, gint *new_column
- )
+ gint row, gint col,
+ gint *new_row, gint *new_column
+ )
{
+ gint case_count;
PsppireDataStore *data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(sheet));
-
const gint n_vars = psppire_dict_get_var_cnt(data_store->dict);
if ( *new_column >= n_vars )
return FALSE;
+ case_count = psppire_case_file_get_case_count(data_store->case_file);
+
+ if ( *new_row >= case_count )
+ {
+ gint i;
+
+ for ( i = case_count ; i <= *new_row; ++i )
+ psppire_data_store_insert_new_case (data_store, i);
+
+ return TRUE;
+ }
+
return TRUE;
}
switch (page)
{
+ case PAGE_VAR_SHEET:
+ break;
case PAGE_DATA_SHEET:
{
GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
}
-void
-on_insert1_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- GtkNotebook *notebook = GTK_NOTEBOOK(get_widget_assert(xml, "notebook1"));
- gint page = -1;
-
- page = gtk_notebook_get_current_page(notebook);
-
- switch (page)
- {
- case PAGE_DATA_SHEET:
-#if 0
- {
- GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
- PsppireDataStore *data_store =
- PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet));
-
- psppire_case_array_insert_case(data_store->cases,
- data_sheet->range.row0,
- blank_case, the_dictionary);
- }
- break;
-#endif
- case PAGE_VAR_SHEET:
- {
- GtkSheet *var_sheet =
- GTK_SHEET(get_widget_assert(xml, "variable_sheet"));
-
- PsppireVarStore *var_store =
- PSPPIRE_VAR_STORE(gtk_sheet_get_model(var_sheet));
-
- psppire_dict_insert_variable(var_store->dict, var_sheet->range.row0, 0);
- }
- break;
- }
-}
-
-#if 0
-void
-on_delete1_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- gint page = -1;
- GtkWidget *notebook = get_widget_assert(xml, "notebook1");
-
- page = gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook));
- switch ( page)
- {
-#if 0
- case PAGE_DATA_SHEET:
- {
- GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
- PsppireDataStore *data_store =
- PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet));
-
- psppire_case_array_delete_cases(data_store->cases,
- data_sheet->range.row0,
- 1 + data_sheet->range.rowi
- - data_sheet->range.row0 );
- }
- break;
-#endif
- case PAGE_VAR_SHEET:
- {
- GtkSheet *var_sheet =
- GTK_SHEET(get_widget_assert(xml, "variable_sheet"));
-
- PsppireVarStore *var_store =
- PSPPIRE_VAR_STORE(gtk_sheet_get_model(var_sheet));
-
- psppire_dict_delete_variables(var_store->dict,
- var_sheet->range.row0,
- 1 + var_sheet->range.rowi
- - var_sheet->range.row0 );
- }
- break;
- }
-}
-#endif
-
void
on_about1_activate(GtkMenuItem *menuitem,
gpointer user_data)
gtk_sheet_get_active_cell(data_sheet, &row, &col);
- psppire_case_file_insert_case(data_store->case_file, row);
+ psppire_data_store_insert_new_case(data_store, row);
}
void
{
PsppireCaseFile *cf = g_object_new (G_TYPE_PSPPIRE_CASE_FILE, NULL);
- cf->flexifile = flexifile_create(val_cnt);
+ cf->flexifile = flexifile_create (val_cnt);
return cf;
}
return result;
}
-/* Insert a blank case to the case file */
+/* Insert case CC into the case file before POSN */
gboolean
psppire_case_file_insert_case(PsppireCaseFile *cf,
- gint posn)
+ struct ccase *cc,
+ gint posn)
{
bool result ;
- struct ccase cc;
g_return_val_if_fail(cf, FALSE);
g_return_val_if_fail(cf->flexifile, FALSE);
- case_create (&cc, casefile_get_value_cnt(cf->flexifile));
-
- result = flexifile_insert_case(FLEXIFILE(cf->flexifile), &cc, posn);
+ result = flexifile_insert_case(FLEXIFILE(cf->flexifile), cc, posn);
- case_destroy (&cc);
-
if ( result )
g_signal_emit(cf, signal[CASE_INSERTED], 0, posn);
else
return result;
}
+
/* Append a case to the case file */
gboolean
psppire_case_file_append_case(PsppireCaseFile *cf,
/* Resize the cases in the casefile, by inserting N_VALUES into every
one of them. */
gboolean
-psppire_case_file_insert_values(PsppireCaseFile *cf,
- gint n_values, gint before)
+psppire_case_file_insert_values (PsppireCaseFile *cf,
+ gint n_values, gint before)
{
g_return_val_if_fail(cf, FALSE);
return TRUE;
}
- return flexifile_resize(FLEXIFILE(cf->flexifile), n_values, before);
+ return flexifile_resize (FLEXIFILE(cf->flexifile), n_values, before);
}
-
-
-
/* Fills C with the CASENUMth case.
Returns true on success, false otherwise.
*/
gboolean
-psppire_case_file_get_case(const PsppireCaseFile *cf, gint casenum,
+psppire_case_file_get_case (const PsppireCaseFile *cf, gint casenum,
struct ccase *c)
{
- g_return_val_if_fail(cf, FALSE);
- g_return_val_if_fail(cf->flexifile, FALSE);
+ g_return_val_if_fail (cf, FALSE);
+ g_return_val_if_fail (cf->flexifile, FALSE);
- return flexifile_get_case(FLEXIFILE(cf->flexifile), casenum, c);
+ return flexifile_get_case (FLEXIFILE(cf->flexifile), casenum, c);
}
gboolean psppire_case_file_append_case(PsppireCaseFile *cf,
struct ccase *c);
+gboolean psppire_case_file_insert_case(PsppireCaseFile *cf, struct ccase *c, gint row);
+
gint psppire_case_file_get_case_count(const PsppireCaseFile *cf);
gboolean psppire_case_file_delete_cases(PsppireCaseFile *cf, gint n_rows,
gint first);
-gboolean psppire_case_file_insert_case(PsppireCaseFile *cf, gint row);
-
-
gboolean psppire_case_file_insert_values(PsppireCaseFile *cf, gint n_values, gint before);
struct sort_criteria;
store = PSPPIRE_DATA_STORE(data);
- /*
- if ( adjustment > 0 )
- */
psppire_case_file_insert_values (store->case_file, adjustment, posn);
}
}
+
+/* Insert a blank case before POSN */
+gboolean
+psppire_data_store_insert_new_case(PsppireDataStore *ds, gint posn)
+{
+ gboolean result;
+ gint val_cnt, v;
+ struct ccase cc;
+ g_return_val_if_fail (ds, FALSE);
+
+
+ /* Opportunity for optimisation exists here when creating a blank case */
+ val_cnt = casefile_get_value_cnt(ds->case_file->flexifile) ;
+
+ case_create (&cc, val_cnt);
+
+ memset ( case_data_rw (&cc, 0), 0, val_cnt * MAX_SHORT_STRING);
+
+ for (v = 0 ; v < psppire_dict_get_var_cnt (ds->dict) ; ++v)
+ {
+ const struct PsppireVariable *pv = psppire_dict_get_variable(ds->dict, v);
+ if (ALPHA == psppire_variable_get_type(pv) )
+ continue;
+
+ case_data_rw (&cc, psppire_variable_get_fv (pv))->f = SYSMIS;
+ }
+
+ result = psppire_case_file_insert_case (ds->case_file, &cc, posn);
+
+ case_destroy (&cc);
+
+ return result;
+}
+
+
static gchar *
-psppire_data_store_get_string(const GSheetModel *model, gint row, gint column)
+psppire_data_store_get_string (const GSheetModel *model, gint row, gint column)
{
gint idx;
char *text;
GString *s;
PsppireDataStore *store = PSPPIRE_DATA_STORE(model);
- g_return_val_if_fail(store->dict, NULL);
- g_return_val_if_fail(store->case_file, NULL);
+ g_return_val_if_fail (store->dict, NULL);
+ g_return_val_if_fail (store->case_file, NULL);
- if (column >= psppire_dict_get_var_cnt(store->dict))
+ if (column >= psppire_dict_get_var_cnt (store->dict))
return NULL;
- if ( row >= psppire_case_file_get_case_count(store->case_file))
+ if ( row >= psppire_case_file_get_case_count (store->case_file))
return NULL;
- pv = psppire_dict_get_variable(store->dict, column);
+ pv = psppire_dict_get_variable (store->dict, column);
- idx = psppire_variable_get_fv(pv);
+ idx = psppire_variable_get_fv (pv);
- v = psppire_case_file_get_value(store->case_file, row, idx);
+ v = psppire_case_file_get_value (store->case_file, row, idx);
g_return_val_if_fail(v, NULL);
if ( store->show_labels)
{
- const struct val_labs * vl = psppire_variable_get_value_labels(pv);
+ const struct val_labs * vl = psppire_variable_get_value_labels (pv);
const gchar *label;
if ( (label = val_labs_find(vl, *v)) )
}
}
- fp = psppire_variable_get_write_spec(pv);
+ fp = psppire_variable_get_write_spec (pv);
s = g_string_sized_new (fp->w + 1);
- g_string_set_size(s, fp->w);
+ g_string_set_size (s, fp->w);
- memset(s->str, 0, fp->w);
+ memset (s->str, 0, fp->w);
- g_assert(fp->w == s->len);
+ 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. */
data_out (s->str, fp, v);
- text = pspp_locale_to_utf8(s->str, fp->w, 0);
- g_string_free(s, TRUE);
+ text = pspp_locale_to_utf8 (s->str, fp->w, 0);
+ g_string_free (s, TRUE);
+
+ g_strchomp (text);
return text;
}
static gboolean
-psppire_data_store_clear_datum(GSheetModel *model,
+psppire_data_store_clear_datum (GSheetModel *model,
gint row, gint col)
{
struct file_handle;
-void psppire_data_store_create_system_file(PsppireDataStore *store,
- struct file_handle *handle);
+void psppire_data_store_create_system_file (PsppireDataStore *store,
+ struct file_handle *handle);
+
+gboolean psppire_data_store_insert_new_case (PsppireDataStore *ds, gint posn);
+
#ifdef __cplusplus