[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src data/ChangeLog data/casereader.c data/... [simpler-p
From: |
John Darrington |
Subject: |
[Pspp-cvs] pspp/src data/ChangeLog data/casereader.c data/... [simpler-proc] |
Date: |
Tue, 29 May 2007 00:27:47 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Branch: simpler-proc
Changes by: John Darrington <jmd> 07/05/29 00:27:46
Modified files:
src/data : ChangeLog casereader.c datasheet.c procedure.c
src/ui/gui : psppire.c
Log message:
Made datasheet/casereader work (sort of) with the GUI
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/ChangeLog?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.108.2.1&r2=1.108.2.2
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/casereader.c?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.1.2.8&r2=1.1.2.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/datasheet.c?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.1.2.12&r2=1.1.2.13
http://cvs.savannah.gnu.org/viewcvs/pspp/src/data/procedure.c?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.25.2.5&r2=1.25.2.6
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/psppire.c?cvsroot=pspp&only_with_tag=simpler-proc&r1=1.35.2.2&r2=1.35.2.3
Patches:
Index: data/ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/data/ChangeLog,v
retrieving revision 1.108.2.1
retrieving revision 1.108.2.2
diff -u -b -r1.108.2.1 -r1.108.2.2
--- data/ChangeLog 19 Mar 2007 21:36:24 -0000 1.108.2.1
+++ data/ChangeLog 29 May 2007 00:27:46 -0000 1.108.2.2
@@ -1,3 +1,12 @@
+29 May 2007 John Darrington <address@hidden>
+
+ * casereader.c: Fixed bug in casereader_count_cases.
+
+ * datasheet.c: Avoid assertions when creating a datasheet from an
+ empty source.
+
+ * procedure.c: Re-added callbacks.
+
Fri Dec 22 13:56:08 2006 Ben Pfaff <address@hidden>
Simplify missing value handling.
Index: data/casereader.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/Attic/casereader.c,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -b -r1.1.2.8 -r1.1.2.9
--- data/casereader.c 7 May 2007 05:16:08 -0000 1.1.2.8
+++ data/casereader.c 29 May 2007 00:27:46 -0000 1.1.2.9
@@ -233,16 +233,18 @@
{
if (reader->case_cnt == CASENUMBER_MAX)
{
- struct casereader *clone;
+ casenumber n_cases = 0;
struct ccase c;
- reader->case_cnt = 0;
+ struct casereader *clone = casereader_clone (reader);
- clone = casereader_clone (reader);
for (; casereader_read (clone, &c); case_destroy (&c))
- reader->case_cnt++;
+ n_cases++;
+
casereader_destroy (clone);
+ reader->case_cnt = n_cases;
}
+
return reader->case_cnt;
}
Index: data/datasheet.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/Attic/datasheet.c,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -b -r1.1.2.12 -r1.1.2.13
--- data/datasheet.c 4 May 2007 03:48:47 -0000 1.1.2.12
+++ data/datasheet.c 29 May 2007 00:27:46 -0000 1.1.2.13
@@ -167,8 +167,6 @@
{
size_t column_cnt;
casenumber row_cnt;
- unsigned long int column_start;
- unsigned long int row_start;
struct source_info *si;
si = xmalloc (sizeof *si);
@@ -177,15 +175,21 @@
row_cnt = source_get_backing_row_cnt (si->source);
source_increase_use (si->source, column_cnt);
+ if ( column_cnt > 0 )
+ {
+ unsigned long int column_start;
column_start = axis_extend (ds->columns, column_cnt);
axis_insert (ds->columns, 0, column_start, column_cnt);
range_map_insert (&ds->sources, column_start, column_cnt,
&si->column_range);
+ }
+ if ( row_cnt > 0 )
+ {
+ unsigned long int row_start;
row_start = axis_extend (ds->rows, row_cnt);
axis_insert (ds->rows, 0, row_start, row_cnt);
-
- return ds;
+ }
}
return ds;
Index: data/procedure.c
===================================================================
RCS file: /sources/pspp/pspp/src/data/procedure.c,v
retrieving revision 1.25.2.5
retrieving revision 1.25.2.6
diff -u -b -r1.25.2.5 -r1.25.2.6
--- data/procedure.c 7 May 2007 05:16:08 -0000 1.25.2.5
+++ data/procedure.c 29 May 2007 00:27:46 -0000 1.25.2.6
@@ -340,6 +340,7 @@
ds->discard_output = false;
}
ds->sink = NULL;
+ if ( ds->replace_source) ds->replace_source (ds->source);
caseinit_clear (ds->caseinit);
caseinit_mark_as_preinited (ds->caseinit, ds->dict);
@@ -481,6 +482,7 @@
dict_destroy (ds->dict);
ds->dict = ds->permanent_dict;
ds->permanent_dict = NULL;
+ if (ds->replace_dict) ds->replace_dict (ds->dict);
trns_chain_destroy (ds->temporary_trns_chain);
ds->temporary_trns_chain = NULL;
@@ -552,6 +554,7 @@
casereader_destroy (ds->source);
ds->source = NULL;
+ if ( ds->replace_source) ds->replace_source (NULL);
proc_cancel_all_transformations (ds);
}
@@ -570,6 +573,7 @@
dict_destroy (ds->dict);
ds->dict = dict;
+ if ( ds->replace_dict) ds->replace_dict (dict);
proc_set_active_file_data (ds, source);
}
@@ -581,6 +585,7 @@
{
casereader_destroy (ds->source);
ds->source = reader;
+ if (ds->replace_source) ds->replace_source (reader);
caseinit_clear (ds->caseinit);
caseinit_mark_as_preinited (ds->caseinit, ds->dict);
Index: ui/gui/psppire.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/psppire.c,v
retrieving revision 1.35.2.2
retrieving revision 1.35.2.3
diff -u -b -r1.35.2.2 -r1.35.2.3
--- ui/gui/psppire.c 14 Apr 2007 05:04:23 -0000 1.35.2.2
+++ ui/gui/psppire.c 29 May 2007 00:27:46 -0000 1.35.2.3
@@ -1,3 +1,4 @@
+#include <data/casereader.h>
/*
PSPPIRE --- A Graphical User Interface for PSPP
Copyright (C) 2004, 2005, 2006 Free Software Foundation
@@ -70,11 +71,12 @@
static void
-replace_flexifile (struct casereader *s)
+replace_casereader (struct casereader *s)
{
- if ( NULL == s )
+ struct datasheet *datasheet = datasheet_create (s);
+
psppire_case_file_replace_datasheet (the_data_store->case_file,
- datasheet_create (NULL));
+ datasheet);
}
@@ -120,7 +122,7 @@
fn_getenv_default ("STAT_INCLUDE_PATH", include_path)
);
- the_dataset = create_dataset (replace_flexifile,
+ the_dataset = create_dataset (replace_casereader,
replace_dictionary);
message_dialog_init (the_source_stream);
@@ -134,9 +136,13 @@
/* Create the model for the var_sheet */
the_var_store = psppire_var_store_new (dictionary);
-
the_data_store = psppire_data_store_new (dictionary);
+
+ proc_set_active_file_data (the_dataset,
+ datasheet_make_reader
(the_data_store->case_file->datasheet));
+
+
create_icon_factory ();
new_data_window (NULL, NULL);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src data/ChangeLog data/casereader.c data/... [simpler-proc],
John Darrington <=