Ben Pfaff [Sat, 20 Jun 2020 21:52:40 +0000 (21:52 +0000)]
sys-file-reader: Accept bad variable indexes, with warnings.
The SPSS file writer software at
https://packagist.org/packages/tiamo/spss sometimes generates malformed
variable indexes for weighting variables or value label records. PSPP
until now has rejected these files entirely. This commit should make
it issue a warning instead.
Thanks to István Ignácz for reporting this issue at
https://lists.gnu.org/archive/html/pspp-users/2020-06/msg00012.html
main.c: set "register-session" property for gtk_application
To open an application by clicking an associated file like
grid.sps in the Finder on Macos requires that the property
"register-session" is set for gtk_application. I did not
find a negative impact on Debian bullseye so I hope this
works also on other platforms. The gtk support for this
will be in the next gtk-3-24 release.
desktop file: added Keywords and removed Education category
During debian packaging of 1.2.0-5 the missing Keywords entry
was mentionend. I removed the Education category because this
was mentioned also. Education and Science are both toplevel
categories. I added also two more mimetypes for .sps and .spv
files.
desktop: changed translations to msgfmt and xgettext
During the build of the debian package 1.2.0-5 it turned out
that the pspp.appdata.xml file has a wrong structure with
respect to the translations. I did the following things
- renamed pspp.appdata.xml to org.fsf.pspp.metainfo.xml
- added gettext translation support for org.fsf.metainfo.xml
- renamed pspp.desktop to org.fsf.pspp.desktop
- replaced gen-det-desktop.sh based translation with gettext
gettext has now support for translating .desktop and .metainfo.xml
files. I took the naming conventions from the freedesktop and gnome
documentation, i.e. metainfo instead of appdata and the use of
an organization name.
John Darrington [Sat, 20 Jun 2020 05:17:06 +0000 (07:17 +0200)]
find-dialog.c: Replace exp10 with our own integer version
A previous commit introduced the use of exp10 from the standard
math library. However the use cases here don't need floating
point operands, and it's smaller and faster to implement our
own integer version.
John Darrington [Sat, 20 Jun 2020 05:17:06 +0000 (07:17 +0200)]
Fix buffer overflow in linear regression.
When the dependent variable and the indepdendent variable
are one and the same (a rather pointless situation), a buffer overflow
would occur. This change fixes that.
exp10 replaced with pow when exp10 is not available
The exp10 function that was introduced by commit aae1a8f067ddd9c09
in the find-dialog is not available on MacOS. I added a check
and replace it with pow if exp10 is not available.
John Darrington [Sun, 14 Jun 2020 15:07:27 +0000 (17:07 +0200)]
GUI: Find dialog: Compare only to the decimal places of the print format.
When using the find dialog of the data editor, previously a numeric value
was compared exactly on it's underlying representation (a IEEE754 double
precision float). This is problematic, because most such floats cannot
be precisely represented in a decimal format, and even if they can be, the
precision required might well exceed that displayed in the data editor.
This change rounds both the reference and the comparand to the number of
decimal places indicated by the variable's print format.
help: added help_page property at various ui files
I added the help_page property in the
- k-independent.ui
- k-related.ui
and at various sub dialogs where options are set. With the
help_page property a more meaningful page in the documentation
is called instead of the toplevel documentation.
doc: added prepdoc.sh script for simple working on documentation
I added the prepdoc.sh script to allow to work on the documentation
without having the full build environment. You can just checkout
from git and then run
cd pspp/doc
./prepdoc.sh
makeinfo --html pspp.texi
open ./pspp/index.html
Maybe it is then easier for contributors to work on the documentation
without having to run Smake and configure with all the required
packages. prepdoc.sh will generate some dummy required texi files
which are normally generated during the build process.
When a .sav file was openend, then a wrong "goto case" option
is visible in the variable view. With this fix you can
open a new dataset via the file browser and the correct menu
is shown.
The goto case dialog did not work. The GtkTreeModel cast of the datasheet
does not work because datasheet is not derived from treemodel. Changed
types from casenumber to gint because the gtktreemodel function returns gint.
casenumber is long which my be bigger than int but the treemodel cant handle
this anyway.
fixed variable type change during text import bug #58298
Changing the variable type during the import dialog resulted
in a crash. The reason is that the import data is stored as
strings in a treeview and converted to union value depending
on the variable type. When the variable type is changed, there
is a discrepancy between then caseproto in the reader and the
variable. This results in an assertion.
As a fix I store the dictionary at the time of creation of the
casereader. When a variable is changed i reinitialize the
casereader.
Deleting many variables (like 300) via the gui
in a dataset with many variables (like 500) results
in long gui response times because each variable is
deleted individually by iteration. This results in many
items-changed callbacks which will result in long
gui waiting times. This patch reduces the number of
callbacks and the gui response is much faster.
The variable insert procedure inserted new variables
via the datasheet window even if the variable
window was visible. Directly after startup the
dataview is not realized and that prevents a correct
update of the variable view. I changed the procedure
such that the ssw items_changed_cb is called for
the widgets in the variable view and the window
is correctly updated.
Makefile.am - added check for debian package directory
The debian package is now also maintained via git
https://salsa.debian.org/science-team/pspp
but that repository contains the distribution package. Due to the
.git directory the make process assumes that we are building
a distribution file and adds a check for some missing files. That
check fails if the distribution is under git control. I checked
for the existance of the debian directory as an indicator that
we are building the debian package and disable the check.
The SET WIDTH setting was ignored. This makes the code honor it for
output to a file. For output to a terminal, the terminal's width is
used instead.
Honor changes to SET WIDTH as well.
The code to detect terminal size changes wasn't properly signal safe,
and it was scattered across multiple files. This centralizes it and
makes it signal safe.
There were bugs in updates to min_hbreak in corner cases. This fixes
them.
Thanks to Frans Houweling and John Darrington for reporting these
bugs.
Ben Pfaff [Mon, 30 Dec 2019 06:42:02 +0000 (06:42 +0000)]
spv: Run Python at build time via $PYTHON variable.
This was accidentally being run as literal "python" rather than through
a variable, so it failed on systems where there is no "python" binary
but only python2 or python3.
Ben Pfaff [Sun, 29 Dec 2019 16:25:57 +0000 (16:25 +0000)]
cairo: Fix font scaling.
It's really a mystery why a 9-point font doesn't appear 9 points tall
in PDF (etc.) output, but it doesn't. I guess we're doing something
wrong somewhere. But until we figure out the underlying issue, we need
to scale down font sizes for PDF and not for on-screen use.
This is a slightly better fix for font sizes than the previous commit 3c15b41c036 (pivot-table: Kluge dropping default 9-point font to make
output readable.)
Ben Pfaff [Sun, 29 Dec 2019 15:53:25 +0000 (15:53 +0000)]
pivot-table: Kluge dropping default 9-point font to make output readable.
The default font size for SPV output is normally 9 points, but that
makes the output window hard to read. This drops that default entirely,
which seems to make the output use a system or Pango default. This is
probably not the right thing to do--probably we need a way to magnify
the fonts for on-screen display.
This reverts part of commit e3c3fbe8b, which wasn't intended to have a
visible effect but did because it inadvertently introduced a 9-point
default.
Ben Pfaff [Thu, 26 Dec 2019 00:52:33 +0000 (00:52 +0000)]
table: Get rid of TAB_* for horizontal and vertical alignment.
Until now, either TAB_LEFT, TAB_RIGHT, etc. could be used or the
area_style mechanism could be used. The latter has a superset of the
former's features, so this commit eliminates the former.
Ben Pfaff [Sat, 19 Oct 2019 05:41:25 +0000 (05:41 +0000)]
driver: Do not accumulate marked-up text.
The output engine accumulates lines of text into blocks and outputs them
all at once. This doesn't currently work for text with markup, so this
commit disables it. It might be better to make it work, hence this
commit also adds an XXX marker.