John Darrington [Wed, 16 Sep 2015 05:30:57 +0000 (07:30 +0200)]
Text file importer: Initialise the total_is_exact variable.
The text file importer was supposed to have a feature where the total number of lines
in the file was measured if the file was short, or estimated if it was long. However
the variable which was supposed to hold this information was never initialised. This
change fixes that.
John Darrington [Tue, 15 Sep 2015 16:17:19 +0000 (18:17 +0200)]
Ref count struct spreadsheet
struct spreadsheet is a base class for which all current derivations
are ref counted. It makes sense then to have the base class refcounted
instead of the more derived ones
John Darrington [Sat, 12 Sep 2015 10:38:50 +0000 (12:38 +0200)]
Fix dereference to reallocated pointer in data-parser.c (parse_delimited_no_span, parse_delimited_span)
The parse_delimited_span and parse_delimited_no_span functions were
accessing a pointer from within a loop, but the pointer had been
initialised outside the loop. However the loop itself was deallocating
the memory referenced by that pointer.
This change initialises the pointer within the loop so as to avoid
a potential crash here.
A number of users have complained that the import dialog assistant
crashes on exit. This seems to be because some callback is accessing
the data after it has been freed.
This change "fixes" that by simply not ever freeing the data. This
will cause a memory leak. However during my investigations, I have
found that this dialog leaks so much anyway that these few bytes are
hardly significant.
John Darrington [Mon, 17 Aug 2015 17:00:53 +0000 (19:00 +0200)]
Restore the splash screen.
Re-implementat the splash screen, using functinos which are not
deprecated under Gtk3. Note: This implementation does not
use the gtk functions which the Gtk devs recommend for splash screens.
What they forget, is that a primary purpose of a splash screen is
that it should appear with the minimum of delay. gtk_init can
have significant delay - hence the recommended way of doing splash
screens in Gtk is self defeating.
John Darrington [Sun, 26 Jul 2015 08:22:32 +0000 (10:22 +0200)]
PsppireDialogAction and subclasses - use function to set class activate and thus minimise deprecation warnings
All subclasses of PsppireDialogAction needed to use GtkActionClass. This widget however
is deprecated in recent Gtk versions. Meaning that all instances of PsppireDialogAction
implementations would provoke a deprecation warning at compile time.
This change avoids that by providing a common function to set GtkActionClass->activate.
Thus, there is now only a single warning instead of many.
Ben Pfaff [Sat, 25 Jul 2015 20:44:07 +0000 (13:44 -0700)]
sys-file-reader: Change some errors to warnings.
I encountered some system files with corrupt data in the long string
missing value record. Until now, this entirely prevented the file from
being read. This commit changes that to just a warning, enabling the file
to be read.
Also revises system file format documentation to better explain that
unknown or corrupted extension records should be ignored.
Ben Pfaff [Sat, 25 Jul 2015 15:58:06 +0000 (08:58 -0700)]
dictionary: Make dict_delete_var() much faster in common case.
When a system file is opened, dict_delete_consecutive_vars() deletes lots
of variables if the system file has long string variables. This was very
slow because of the O(n**2) behavior in dict_delete_var(). The biggest
cost of that O(n**2) behavior was in calling var_clone() on every variable
several times. Fortunately, the var_clone() call is not necessary in this
case, because the cloned variable is only needed for callbacks, which
aren't set when a dictionary is being read.
This reduced the time to read the dictionary in a particular sample system
file from seconds to milliseconds.
Ben Pfaff [Tue, 21 Jul 2015 03:43:00 +0000 (20:43 -0700)]
GET DATA/TYPE=TXT: Remove ESCAPE subcommand and make its behavior default.
Frans Houweling reported that this is the default and only behavior for
GET DATA/TYPE=TXT in SPSS 14, at:
http://lists.gnu.org/archive/html/pspp-users/2015-07/msg00027.html
Therefore, this commit makes this behavior the default and only behavior
in PSPP as well. (In my opinion it's the only sensible behavior, but SPSS
didn't document it so I assumed that it didn't do it that way.)
missing-val-dialog.c: fixed bug #45419 - added value type checks
This patch fixes bug #45419:
psppire crashes when entering missing data in new string variable.
The missing value width is now derived from the variable type. I noticed that
there are currently no type checks and no detailed warnings. I added the type
checks which were already provided by data_in and forward them to the existing
error dialog box. If an error is detected, the focus of the dialog box is
set to the field which produces the error.
psppire-output-view.c: added check for view->xr - fixes bug #45421
The output windows crashed when an empty syntax window is executed. The
rerender function got called without a valid view->xr (=NULL). I added a
check for this condition and create a new view->xr as it is done in the
psppire_output_view_put function.
This fixes bug #45421: Crash when trying to run empty syntax
fix s390x build failure on debian due to wrong type casting
The problem showed up on s390x for the 0.8.5 debian version
where four graph tests using pdf export failed with the same assertion. The
problem is due to wrong casting. intptr_t is long int (64 Bit) on s390x
but nl_langinfo returns 0xd200000000 on s390x where 0 is the integer result.
This results in wrong but positive height and width values for the paper size.
fix crash when exporting pdf via gui - fixes bug #45272
The problem https://savannah.gnu.org/bugs/?45272 occurs when the pdf
export is done via the gui. The problem is that tables containing only
carriage returns are considered to have no vertical space consumption.
Ben Pfaff [Sun, 21 Jun 2015 17:05:29 +0000 (10:05 -0700)]
configure: With -Werror, add -Wno-error=deprecated-declarations.
The PSPP code for GTK+3 still uses several deprecated interfaces, so
using -Werror without -Wno-error=deprecated-declarations prevents the tree
from compiling.
Ben Pfaff [Sun, 21 Jun 2015 17:01:29 +0000 (10:01 -0700)]
pspp-sheet-view: Removed unused variable.
Commit 9682fa965a7d (fixed scrolling of edited cell - fixes bug #45113)
removed all uses of local variable 'requisition' from
pspp_sheet_view_real_start_editing(), but did not remove the declaration.
This commit removes the declaration.
Ben Pfaff [Sun, 21 Jun 2015 16:59:17 +0000 (09:59 -0700)]
pspp-sheet-view: Remove write-only variable from pspp_sheet_view_draw_bin().
Commit 9682fa965 (fixed scrolling of edited cell - fixes bug #45113)
removed the only code that uses the variable of 'has_special_cell' from
pspp_sheet_view_draw_bin(), but retained the code that set its value.
This commit removes the variable entirely.
John Darrington [Sun, 21 Jun 2015 06:10:46 +0000 (08:10 +0200)]
PsppireOutputView redefined parameter y to be of type long.
The variable y was defined as int, but being cast to long when set in the tree store. This seems like it
could give rise to integer overflow. This change redefines y to be of type long.
John Darrington [Wed, 17 Jun 2015 20:11:25 +0000 (22:11 +0200)]
Charts: internationalise representation of scientific format.
It seems that when representing real numbers in scientific
notation, there are several cultural conventions. This change
allows the translators to choose the convention best suited
to their locale.