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.
charts: switched from bullet operator to multiplication sign for numbers
The previous switch to pango used the bullet operator for the display
of scientific numbers in charts. Now the numbers are displayed in the
form: 1.5x10^5 instead as 1.5.10^5.
charts: switched from bullet operator to multiplication sign for numbers
The previous switch to pango used the bullet operator for the display
of scientific numbers in charts. Now the numbers are displayed in the
form: 1.5x10^5 instead as 1.5.10^5.
Ben Pfaff [Mon, 15 Jun 2015 15:22:17 +0000 (08:22 -0700)]
tests: Unset $TERM to avoid error if $TERM is set to an unknown terminal.
Reported by Friedrich Beckmann <friedrich.beckmann@gmx.de>.
See failed tests here:
https://launchpadlibrarian.net/209052134/buildlog_ubuntu-wily-i386.pspp_0.8.4-1_BUILDING.txt.gz
Ben Pfaff [Sun, 14 Jun 2015 21:24:20 +0000 (14:24 -0700)]
plot-hist-cairo: Clip normal curve.
Otherwise a tall normal curve can go way above the intended data
rectangle to spill out even beyond the page boundary, as shown in
the PDF examples in bug #45192.
gtk3 - output window: migrated to style context, less rerendering
I replaced the deprecated gtk_style_get with the style_context
constructs. The rerendering is now only called after size-allocation or
style updates. The xr fonts are only updated after a style-updated
signal. The style is now derived from the view class for the GtkLayout
widget.
output window: click on overview item adjusts output view (jump)
On MacOS clicking on the overview item did not result in a correct
adjustment of the output window. The reason is that view->y is of type
integer but type long is stored in the treestore. This requires correct
type casting.
replaced decimal module, xrchart_scale with autoformat, histogram x-axis ticks changed.
During gtk3 osx debugging the decimal unit crashed. I replaced the decimal computations
with traditional tick interval computation plus a printf format string generation which is
adapted to the chosen tick style.
The xrchart scales writing are adapted to use this mechanism. If the tick text is too long
to fit in the interval, then the tick label uses the existing rotation by 45 degrees. I added
some space below the x-axis to make the tick labels visible. Maybe the tick label placement
could also be done in two rows for the even and odd ticks.
The histogram x-axis tick generation is changed from a tick per bin to the usual
normal x-axis tick generation. This allows easier visual bin border identification.
The bin width is adapted to the chosen x-axis tick scale. Any number of bins can now
be visualized. This is according to the spss examples I found for the histograms.
output window: click on overview item adjusts output view (jump)
On MacOS clicking on the overview item did not result in a correct
adjustment of the output window. The reason is that view->y is of type
integer but type long is stored in the treestore. This requires correct
type casting.
I added allocation setting to the drawing areas in the output window. The
problem occured in osx gtk3 branch and is described in bug #45229. The
content of the output window was not rendered correctly in the initial
window but only after a resize. Setting the size request for the drawing
areas is not enough because the current allocation is not immediatly changed.
The clipping is based on the current allocation, while the drawing is based
on the results from the rerender function. This problem is related to
the problem described in bug #43362.
replaced decimal module, xrchart_scale with autoformat, histogram x-axis ticks changed.
During gtk3 osx debugging the decimal unit crashed. I replaced the decimal computations
with traditional tick interval computation plus a printf format string generation which is
adapted to the chosen tick style.
The xrchart scales writing are adapted to use this mechanism. If the tick text is too long
to fit in the interval, then the tick label uses the existing rotation by 45 degrees. I added
some space below the x-axis to make the tick labels visible. Maybe the tick label placement
could also be done in two rows for the even and odd ticks.
The histogram x-axis tick generation is changed from a tick per bin to the usual
normal x-axis tick generation. This allows easier visual bin border identification.
The bin width is adapted to the chosen x-axis tick scale. Any number of bins can now
be visualized. This is according to the spss examples I found for the histograms.
histogram tick drawing - added format generation for optimum tick drawing
Fixes bug #45192 which showed up in the gtk3 branch on MacOS.
It replaces the decimal_xxx computations with a routine that computes a
formatting string and a scale factor for a given axis range and number of
bins. The formatting will switch between normal and scientific depending on
the length of the displayed label text. The formatting is such that no
rounded numbers like 3.9999999 when in fact 4 is expected is shown.
Differences between bins remain visible in the tick labels.
In addition the width of the rendered labels is compared with the width
of the bins in the display such that the labels will automatically
switch between horizontal and 45 degree display.
histogram tick drawing - added format generation for optimum tick drawing
Fixes bug #45192 which showed up in the gtk3 branch on MacOS.
It replaces the decimal_xxx computations with a routine that computes a
formatting string and a scale factor for a given axis range and number of
bins. The formatting will switch between normal and scientific depending on
the length of the displayed label text. The formatting is such that no
rounded numbers like 3.9999999 when in fact 4 is expected is shown.
Differences between bins remain visible in the tick labels.
In addition the width of the rendered labels is compared with the width
of the bins in the display such that the labels will automatically
switch between horizontal and 45 degree display.
gtk3 - adapted draw routine to gtk_cairo_should_draw_window. gtk-criticals with undefined drag window disappeared. The gtk-criticals showed up in debian 8.