John Darrington [Sat, 4 Jul 2020 06:38:33 +0000 (08:38 +0200)]
Unref variables after fetching from treeview model.
Commit e511c5a34a8dd5863c5f71c820609c3c0e363cc9 added a reference
to boxed variable pointers. This means they have to be unreffed
after fetching one with gtk_tree_model_get.
John Darrington [Sat, 4 Jul 2020 06:38:33 +0000 (08:38 +0200)]
Follow-up to bugfix #58664
If the width of a variable changes, then implicitly so does its
missing values --- even if the number of missing values is zero.
This is because the variable's width is cached in the missing_value
struct itself.
trim.c: avoid zero size xnrealloc memory allocation
Without the patch the regression fails on test
GET with /KEEP=ALL crashes -- uncompressed
when I compile with -fsanitize=address on MacOS. The reason
is that xnrealloc is called with a zero size allocation. I
simply avoid this, although it might be perfectly o.k. to do so.
desktop: open a file via xdg-open without additional output window
Currently there is a difference between opening an additional data
file via the Edit->Open menu or by opening a file via xdg-open (same
for doubleclick on Filebrowser). In the latter case the on_open
callback is called which runs an additional post_initialize. That
results in an additional output window.
I changed the behavior such that post_initialize is only called
when there is no psppire window yet. That happens when psppire
is started from a terminal with the file as argument on linux.
Further I check if there is an empty datawindow and replace that
in the same way as it is done via the Edit->Open menu.
John Darrington [Sat, 27 Jun 2020 16:00:16 +0000 (18:00 +0200)]
Fix bug #54784 (again).
Certain GUI entities hold pointers to variables. To ensure that
the variables survive the lifetime of the entity which holds the
pointer, the entity must take a reference.
This is particularly important where a transformation which involves
TEMPORARY of a filter is involved.
The pspp-mode is not automagically active in the 1.2.0-5 debian
release which install the emacs pspp mode. The reason was this
wrong elpa autoload comment.
desktop: add mimetypes application/x-spss-sps and application/x-spss-spv
I added an xml mime package which relates the files .sps and .spv
to a mime type. Via that mime type the files can then be openend
by clicking in the file browser.
desktop: reversed mimetype to application/x-spss-sps
If the mimetype is of type text, then the icons are not found
or displayed in gnome Files. No application except apt seems
to define text based mime types. And for apt it does not work
either. So I reverse.
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.