Ben Pfaff [Sun, 2 Aug 2020 21:26:31 +0000 (21:26 +0000)]
tests: More character encoding issues on command line.
Unix-like systems don't have a command-line encoding, so we can pass
whatever bytes we want. mingw uses some particular encoding for
command line arguments, so this screws up trying to pass UTF-8 in. This
commit side-steps the problem by passing only ASCII characters on the
command line and making the test program decode the bytes.
Ben Pfaff [Sun, 2 Aug 2020 21:26:31 +0000 (21:26 +0000)]
tests: Avoid dealing with character encoding issues on command line.
Unix-like systems don't have a command-line encoding, so we can pass
whatever bytes we want. mingw uses some particular encoding for
command line arguments, so this screws up trying to pass UTF-8 in. This
commit side-steps the problem by passing only ASCII characters on the
command line and making the test program decode the bytes.
Ben Pfaff [Sun, 2 Aug 2020 19:03:42 +0000 (19:03 +0000)]
tests: Don't output to PDF without a good reason.
PDF output can cause spurious error messages from Pango to appear in the
output (which would be nice to fix but I'm not sure how) and it's not
always configured in, so omit it in MRSETS where it's not really needed.
gui: clipboard CUT and COPY store same data with/without label
clipboard store data with or without value labels depending on
the setting in the data view. clipboard cut was always storing
the raw data.
With this patch copy and cut both store raw data or labels
depending on the view setting.
With this patch pasting from clipboard also interprets labels as
valid data. First it is checked if the pasted data is a label for
the destination variable. Then the corresponding data is stored.
John Darrington [Sat, 11 Jul 2020 13:31:33 +0000 (15:31 +0200)]
src/ui/gui/org.fsf.pspp.desktop.in: Add translator hint
Add an instruction to not translate the Icon name. Recent versions of
xgettext (correctly) ignore this entry. But earlier versions erroneously
include it in the list of strings to translate.
John Darrington [Sat, 11 Jul 2020 07:35:29 +0000 (09:35 +0200)]
src/output/cairo-chart.h (xrchart_write_scale): Check the range and deal with the consequences.
If a chart was requested where either scale had an range of zero
(the minimum value and the maximum value were equal), then all
sorts of memory errors could occur later in the chart's rendering.
This change checks for this condition early and refuses to draw the
chart in this case.
gui: cut from editable to clipboard when cell is focused
When a cell is focused, then the cut operation
must operate on the selection in the cell editable
and not on the complete cell, i.e. the store content.
gui: trim displayed string for string variables (spaces)
The current gui always renders strings in the datasheet view
with the full width by adding spaces to the end of a string.
This patch renders the strings in the same way as they are rendered
in the status edit box above the cells array, i.e. trailing whitespace
is removed. Editing strings is straightforward.
gui: render empty string for numeric system missing value
Numeric cells which contain the system missing value are currently rendered
as a number of spaces, a dot and a number of spaces depending on the
current variable width and decimal places settings. When the cell is
edited, then this string is pretty confusing.
With the patch system missing values for numeric variables are rendered
as empty strings. Editing the cell is then straightforward and starts
with an empty cell.
icons: added psppire- prefix to action items #58708, #50026
The edit-find action icon is already available in the default
gnome and kde icon themes. Therefore the default icon is always found
first. I added the psppire- prefix to the action icon names such that
the icons are unique.
John Darrington [Sat, 4 Jul 2020 09:15:04 +0000 (11:15 +0200)]
Mitigate bug #48050
This bug caused an assertion failure in src/data/datasheet.c The change here
traps the faulty condition earlier and raises a G_CRITICAL rather than an
assertion.
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.