Ben Pfaff [Tue, 29 Jun 2010 23:59:42 +0000 (16:59 -0700)]
cairo: Fix handling of font sizes.
Until now this code used pango_font_description_set_absolute_size() to set
the font size. This sets the font size in device units, e.g. pixels on a
display. But font sizes are actual specified by the user in points, so
we should instead use pango_font_description_get_size(). This commit
makes that change.
That change is simple, but it necessitates a larger change.
Until now the cairo driver has just assumed that the size of a font is
the size that we assigned it. But this is no longer the case, since
points and pixels are now different. So now we measure the actual width
and height of characters and use those as the font size. At the same
time, the code no longer ignores font sizes included as part of font
description strings, and allows different fonts to have different sizes.
Ben Pfaff [Wed, 23 Jun 2010 05:36:57 +0000 (22:36 -0700)]
cairo: Remove support for printed headers.
The printed headers on each page do not very attractive, and the
information that they contain by default is not very useful. Because an
upcoming commit makes them harder to properly implement, simply remove
them for now.
With this commit, the cairo driver no longer prints titles and subtitles
at all. This needs to be fixed.
Ben Pfaff [Sat, 26 Jun 2010 19:28:28 +0000 (12:28 -0700)]
output: Fix logic error in table_select_slice().
z1 is a row or column number, not a count of header rows or columns, so it
only makes sense to compare it against another row or column number, not
against a count of rows or columns.
Ben Pfaff [Sat, 26 Jun 2010 17:19:39 +0000 (10:19 -0700)]
Revert unintended change to tests_libpspp_str_test_LDADD.
When I was preparing the previous commit I tested a change to
tests_libpspp_str_test_LDADD and then (I thought) reverted it. But my
revert actually changed the order. Oops.
John Darrington reports that the new order causes link problems for him, so
I'm putting the order back to the original, with this commit.
Ben Pfaff [Sat, 26 Jun 2010 04:33:18 +0000 (21:33 -0700)]
Avoid redundant linking against libtool convenience libraries.
Both libpspp.la and libpspp-core.la linked directly against libgl.la, and
the UI linked against both libpspp.la and libpspp-core.la. This works fine
on ELF systems, but with Mach-O on Mac OS X it silently causes duplicate
symbols at runtime. In particular there are two different copies of
rpl_optarg from libgl.la. Different code sees different copies of these,
which causes a segfault at runtime whenever anyone invokes pspp with an
option that takes an argument.
Reported by Jeremy Lavergne <jeremy@lavergne.gotdns.org>, with debugging
assistance by Jeremy and by John Darrington.
Ben Pfaff [Thu, 17 Jun 2010 03:28:29 +0000 (20:28 -0700)]
README.Git: Upgrade to latest Gnulib.
In particular this incorporates commit 39bdc0a99 "strtod: Stop using
AC_FUNC_STRTOD", which should fix problems with the strtod() replacement
when cross-compiling to Mingw. For more information, see the thread at
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/22091 and PSPP bug
#29965.
Ben Pfaff [Wed, 16 Jun 2010 04:29:50 +0000 (21:29 -0700)]
psppire: Re-implement --help and --version options.
Commit f51ecb4802 "Greatly simplify PSPP configuration." accidentally
removed PSPPIRE support for the --help and --version options. This commit
restores it (and improves upon the text previously displayed).
Ben Pfaff [Wed, 16 Jun 2010 03:41:12 +0000 (20:41 -0700)]
Do not treat isolated CR in input data as new-line.
User "tvw" on IRC reported that PSPP failed to parse data that SPSS 18
accepted. We found that the problem was carriage return (CR) characters
in the middle of a line. PSPP treated these as new-lines, but SPSS did
not. This commit adopts the SPSS behavior in PSPP and adjusts one test
that checks this behavior.
This will break reading some old Mac OS files, since Mac OS before version
10 used CR without LF as new-line. Time will tell whether this is a real
problem for our users.
Ben Pfaff [Fri, 11 Jun 2010 04:31:59 +0000 (21:31 -0700)]
tmpfile: Rename "struct tmpfile" to "struct temp_file".
Mingw builds were failing because Gnulib was replacing "tmpfile" by
"rpl_tmpfile", and this was visible only to some users of "struct tmpfile".
The safest fix seems to be just renaming struct tmpfile, so that's what
this commit does.
Thanks to Harry Thijssen <pspp@sjpaes.nl> for reporting the problem.
John Darrington [Wed, 9 Jun 2010 18:22:43 +0000 (20:22 +0200)]
perl-module/Makefile.PL: Change DLEXT to SO
Apparently the former is for dynamically loaded modules,
whereas the latter is for shared libraries. So SO is
appropriate here. Thanks to Jeremy Lavergne for reporting
this.
Ben Pfaff [Wed, 9 Jun 2010 17:10:03 +0000 (10:10 -0700)]
configure.ac: Do not define DEPENDS_ON_LIBINTL.
If <config.h> defines DEPENDS_ON_LIBINTL, then the relocation wrapper fails
to link at install time when --enable-relocatable is used on a system that
requires the relocation wrapper (e.g. OpenBSD), because the relocation
wrapper does not link against libintl.
Ben Pfaff [Tue, 8 Jun 2010 04:45:33 +0000 (21:45 -0700)]
gui: Create user settings directory if it doesn't already exist.
The user settings directory doesn't necessarily exist. Some program has to
create it, and PSPPIRE might be the first program that wants it, so it
should try to create it.
Ben Pfaff [Sun, 6 Jun 2010 19:45:01 +0000 (12:45 -0700)]
DEBUG EVALUATE: Eliminate lexical corner case, rewrite tests in Autotest.
The DEBUG EVALUATE command, used only for testing, used the
lex_rest_of_line() function. I'd like to eventually get rid of all of the
uses of this function and other unusual lexical corner cases, so this
commit starts off by removing this one.
Ben Pfaff [Sun, 6 Jun 2010 19:23:33 +0000 (12:23 -0700)]
expressions: Improve error message for bad quarter argument to DATE.QYR.
The error message issued by DATE.QYR for an invalid "quarter" argument
referred instead to a "month" value. This makes the error message more
understandable.
Ben Pfaff [Sun, 6 Jun 2010 19:41:08 +0000 (12:41 -0700)]
expressions: Improve "type mismatch" error messages from expression parser.
Before this commit, type mismatches invoking functions in expressions would
yield confusing error messages due to missing type names, e.g.:
Type mismatch invoking MISSING(number) as missing(string).
This commit fills in the missing type names:
Type mismatch invoking MISSING(number) as missing().
An upcoming commit will start checking error messages as part of the tests
for expressions, which should ensure that the problem does not recur.
Ben Pfaff [Sun, 6 Jun 2010 19:43:10 +0000 (12:43 -0700)]
MOMENTS: Avoid lexical corner case in test case.
The DEBUG MOMENTS command, used only for testing, used the
lex_rest_of_line() function. I'd like to eventually get rid of all of the
uses of this function and other unusual lexical corner cases, so this
commit starts off by removing this one.
John Darrington [Thu, 27 May 2010 14:29:10 +0000 (16:29 +0200)]
Added some very rudimentary tests for charts.
Currently, all these tests do is ensure that the syntax which
should generate charts, can run without crashing. More
rigourous tests should be added in the future, when the infrastructure
allows.
Ben Pfaff [Sat, 17 Oct 2009 23:46:21 +0000 (16:46 -0700)]
Fix get-data-txt-importcases.sh test on Mingw.
On Mingw, ftell() and ftello() are unreliable when used on text files with
plain LF line endings:
http://article.gmane.org/gmane.comp.gnu.m4.bugs/2224
This made the get-data-txt-importcases.sh test fail, because
dfm_get_percent_read() that it depends upon to determine the percentage of
the file that has been read uses ftello(). The solution is to always open
the text file as a binary file. According to my audit of the ways that
the text file is read, this should not cause other problems. In
particular, ds_read_line() handles both LF and CR-LF line endings. But it
cannot handle negative effects on Unix platforms anyway, since they do not
distinguish text and binary modes.
Ben Pfaff [Wed, 26 May 2010 04:46:23 +0000 (21:46 -0700)]
perl-module: Copy perl-module files if missing as well as if changed.
I don't know why the behavior here changed, because I don't see any changes
that would cause the problem, but at least the new version makes equal
sense.
John Darrington [Tue, 25 May 2010 08:53:53 +0000 (10:53 +0200)]
Output viewer: Guess file type from filename suffix.
When choosing File|Export in the output viewer,
the dialog box now guesses the desired file format
based upon the given filename suffix.
Closes bug #29867
Ben Pfaff [Sat, 22 May 2010 18:33:48 +0000 (11:33 -0700)]
sys-file-reader: Fix reading overlong value labels for long string variables.
Commit 6b562f8a8 "Add support for value labels on long string variables"
that added support for reading value labels for long string variables from
system files had a logic error in dealing with too-long label strings: the
sign of the subtraction was reversed.
Problem reported by Michel Boaventura <michel@michelboaventura.com>.
Ben Pfaff [Sat, 22 May 2010 18:28:18 +0000 (11:28 -0700)]
dissect-sysfile: Allow padding compressed data at end of file without error.
Compressed data in a system file can end either with a special opcode or
by padding out the last set of opcodes to an 8-byte boundary with null
bytes. Until now, dissect-sysfile has complained about last with
"unexpected end of file". This commit fixes the problem.
John Darrington [Fri, 21 May 2010 11:11:04 +0000 (13:11 +0200)]
Fix crash on Windows when calculating a covariance matrix of dimension 1.
Calculating a covariance matrix on a single variable crashed under Windows.
This change fixes that. It also prevents GUI users from attempting to
perform a correlation with only one variable, since if they are trying to
do that, then the have probably made a mistake.
Ben Pfaff [Fri, 21 May 2010 04:56:48 +0000 (21:56 -0700)]
sys-file-reader: Variable attributes record uses long variable names.
Michel Boaventura provided a system file for which PSPP complained about
bad variable attributes records. I found out that this was because the
variables were specified using long names, not short names. This commit
allows PSPP to read these variable attributes properly.
Ben Pfaff [Thu, 20 May 2010 03:59:28 +0000 (20:59 -0700)]
README.Git: Update to newest Gnulib.
This should fix build failures on OpenSUSE, OpenBSD, and possibly on other
platforms that have libintl but on which libintl does not contain a
definition of __printf__, by integrating the following commit: