Ben Pfaff [Tue, 8 Oct 2013 03:40:24 +0000 (20:40 -0700)]
comments-dialog: Avoid segfault in comments dialog pasting very long text.
The code in wrap_line() used a GtkTextIter after an insertion invalidated
it. In some setups, with a sufficiently long pasted text, this caused a
Gtk-WARNING and a subsequent segfault. This commit fixes the problem by
removing the offending code. In my testing, this didn't cause a UI
regression.
Reported by Bastián Díaz in the thread starting at
http://lists.gnu.org/archive/html/bug-gnu-pspp/2013-10/msg00005.html
Bastián Díaz [Sun, 6 Oct 2013 22:21:18 +0000 (19:21 -0300)]
Provisional new image is added for univariate analysis.
Added a provisional icon to the univariate analysis (experimental).
The image will be updated to a new icon in the next update of
artwork (0.2.1 version).
Changes:
*analyze-univariate-analysis is added
*Smake is edited
*data-editor.ui is edited
John Darrington [Wed, 2 Oct 2013 13:14:15 +0000 (15:14 +0200)]
Replace checkbox-treeview functions with a object PsppireCheckboxTreeview
Prior to this change there existed a function which operated on
a GtkTreeView which populated it with a model and renderers such
that it would display a list of annotated checkboxes.
This change subclasses GtkTreeView and moves the function to a
method of that class.
I anticipate this will ease implementation of upcoming functionality.
John Darrington [Tue, 1 Oct 2013 07:36:06 +0000 (09:36 +0200)]
Detect absence of rl_outstream and handle accordingly.
Older versions of readline do not appear to have the variable rl_outstream. This variable,
almost certainly points to the same stream as stdout, so this change detects its absence
and uses stdout in those cases.
gui: Support for more flat icons and tag loss fixing in some menus.
→ Icons for "new syntax", "new data", "Display information in working
file and external file are added.
→ Add the reference to the new icons to Smake an *.ui files
→ Replacement of some icons (bug fixes)
It improves the esthetics and visual definition of application icon in different sizes of canvas, and adds a scalable version for desktop environments that use that value.
Ben Pfaff [Mon, 30 Sep 2013 07:12:35 +0000 (00:12 -0700)]
variable: Complete renaming of ROLE_OUTPUT to ROLE_TARGET.
Commit 47d59628a7d51a (psppire-var-sheet: Rename references to the icons
for align, measure and role icons) renamed some but not all uses of
ROLE_OUTPUT, breaking the build. This commit completes the rename.
According to Bastián Díaz, "target" is better than "output" because it
is "a broader concept for function".
Ben Pfaff [Mon, 30 Sep 2013 02:11:41 +0000 (19:11 -0700)]
sys-file-reader: Add support for long string missing values.
I assumed earlier that long string missing values used the same fields in
the system file as other missing values, but I was wrong. This commit
updates the support to match what I've seen in actual system files.
Reported by Przemek Powalko <pp.alter.ego@gmail.com>.
Ben Pfaff [Mon, 30 Sep 2013 01:55:38 +0000 (18:55 -0700)]
missing-values: Make mv_add_str() easier to use.
Both existing callers of mv_add_str() were applying their own padding to
the string value. This commit moves the padding into mv_add_str() itself.
This commit also fixes a minor to-do item in the MISSING VALUES command
whereby truncation of too-long missing values was done bytewise rather than
on the basis of full characters.
Ben Pfaff [Sat, 28 Sep 2013 23:26:08 +0000 (16:26 -0700)]
psppire-data-store: Don't try to parse strings as custom currency formats.
Custom currency formats are not usable for input, only for output, but this
code tried to use them for input if the format was changed to a custom
currency format in the GUI. This commit fixes the problem by using a
DOLLAR format, instead, for parsing.
Reported by Bastián Díaz <diaz.bastian@ymail.com>.
Ben Pfaff [Sat, 28 Sep 2013 23:03:32 +0000 (16:03 -0700)]
variable: Only notify variable width change if it really did change.
This code was notifying a width change every time, even if the width did
not really change, which is wasteful. This had a side effect of revealing
a bug in the GUI code which caused an assertion failure. The bug still
remains in the GUI code, though it is now slightly harder to trigger, and
will be fixed separately in an upcoming commit.
John Darrington [Sat, 28 Sep 2013 06:12:53 +0000 (08:12 +0200)]
Documentation: Explain locale issues in the tutorial.
Mention that explicitly setting the input format is necessary if the user wishes
to ignore the system's LC_NUMERIC setting. Otherwise, following the tutorial
strictly to the letter will result in confusing for users whose locale uses a
comma as the decimal separator.
John Darrington [Fri, 27 Sep 2013 12:21:08 +0000 (14:21 +0200)]
Use correct argument order for pool_nmalloc.
This function (and other calloc-like functions) are may not take zero as the size argument. Hence
the order is important. Reported by Przemek Powalko <pp.alter.ego@gmail.com>
Ben Pfaff [Thu, 26 Sep 2013 04:23:41 +0000 (21:23 -0700)]
gui: Avoid referencing freed data upon closing data window.
Without this commit, the following procedure always yielded Glib/GTK+
warnings or criticals for me:
1. Invoke PSPPIRE with a .sav file specified on the command line.
2. Choose Utilities|Variables...
3. Select a variable in the dialog box, then click on Cancel.
3. Close the output window using the window manager.
4. Close the data window using the window manager.
John Darrington [Mon, 23 Sep 2013 14:46:53 +0000 (16:46 +0200)]
Use the msg function to report errors wherever possible.
Previously, some errors were reported using the GNU "error" function from error.h
rather than the PSPP msg function. This wasn't too bad for the terminal user interace,
but gui users could miss important messages (since they never see stderr).
The reason for not using msg in some instances, was twofold: 1) Some
errors might occur before the messaging system had been initialised. 2) If an
error occured whilst reporting an error, an infinite loop would occur.
This change overcomes these problems by detecting re-entrancy, and uninitialised
messaging system, and falling back to fwrite if either of these conditions occur.
John Darrington [Wed, 18 Sep 2013 17:16:08 +0000 (19:16 +0200)]
Calculate Fisher Exact Test even if all cell counts >= 5
Remove the condition that one of the cell counts must be < 5
before calculating the fisher exact test. This condition seems
to be an anachronism, but still (erroneously) documented in Algorithms.
John Darrington [Sat, 7 Sep 2013 05:12:59 +0000 (07:12 +0200)]
Make one of the icon sets a wildcard set.
We currently have two icon sets: A 16x16 and a 24x24 set. Previously,
we had been using the 16x16 set for menuitems and the 24x24 set for the
toolbar. However it appeared that windows uses the symbol GTK_ICON_SIZE_SMALL_TOOLBAR
instead of GTK_ICON_SIZE_LARGE_TOOLBAR, which meant no icons appeared in the
toolbar.
This change sets the 24x24 set as a "wildcard" set meaning it will be used for
all purposes except menuitems.
John Darrington [Wed, 4 Sep 2013 17:32:33 +0000 (19:32 +0200)]
Change instances of GNM_SUPPORT to GNM_READ_SUPPORT
Commit 82c1097ab658e8c13ab3ad439970148defba6e19 used the preprocessor
symbol GNM_READ_SUPPORT but GNM_SUPPORT was the one set in the autconf
files. Hence some code was erroneously omitted.
This change uses GNM_READ_SUPPORT throughout which is consistent
with ODF_READ_SUPPORT
Ben Pfaff [Mon, 2 Sep 2013 20:00:30 +0000 (13:00 -0700)]
data-parser: A hard delimiter at end of line is not an empty field.
Until now, DATA LIST FREE(',') treated input like this:
1,2,
3,4,
as describing six fields, two of which were blank at the end of a line.
A bug report and subsequent experiments showed that in fact this is only
four fields, none of which is blank. This commit fixes the problem and
adds a new test that should avoid regression against this issue.
Ben Pfaff [Fri, 16 Aug 2013 05:35:19 +0000 (22:35 -0700)]
lexer: Rename LEX_ERROR_INTERACTIVE to LEX_ERROR_TERMINAL, change default
The LEX_ERROR_INTERACTIVE error handling mode really only makes sense for
reading from a terminal, where we know we're getting one line at a time
and not partial lines. Unfortunately LEX_ERROR_INTERACTIVE was the default
and it was getting used as such in the GUI for reading from syntax files.
This meant that if there was an error in the GUI then the current buffer
(which might be any arbitrary chunk of syntax) was being discarded, which
caused terrible confusion.
This commit changes the default to LEX_ERROR_CONTINUE, which works
in a reasonable fashion regardless of the input source. It also renames
LEX_ERROR_INTERACTIVE to LEX_ERROR_TERMINAL to make it clear that that's
the only reasonable use.
Reported by Thambu David <thambu@cmcvellore.ac.in>, archived at:
http://lists.gnu.org/archive/html/pspp-users/2013-08/msg00019.html
Ben Pfaff [Mon, 12 Aug 2013 04:56:52 +0000 (21:56 -0700)]
psppire-var-sheet: Hard-code size of pixbuf cells.
Otherwise the icons disappear if the sheet is initially empty, because
there's no icon for an empty row and thus nothing to make the pixbuf cells
nonzero size.
Ben Pfaff [Sat, 10 Aug 2013 16:48:32 +0000 (09:48 -0700)]
gui: Restore icons deleted in error.
These icons were deleted by commit caa467c9a26a7 (gui: Update artwork.)
even though they were still in use. This commit restores them and allows
"make -f Smake" to complete without error.
Ben Pfaff [Mon, 5 Aug 2013 02:42:29 +0000 (19:42 -0700)]
encoding-guesser: Fix bug in parsing fallback encodings.
The encoding guesser originally used UTF-8 as a fallback in situations
where it had already figured out that UTF-8 couldn't be right. Commit d6c75296 (encoding-guesser: Fall back to windows-1252 when UTF-8 can't be
right.) fixed this, by falling back to window-1252 when UTF-8 was known to
be wrong, but it also introduced a bug where this change to the fallback
encoding occurred even when UTF-8 had not be determined to be wrong. This
commit fixes that problem.
Ben Pfaff [Sat, 3 Aug 2013 21:48:36 +0000 (14:48 -0700)]
sys-file-reader: Accept measurement value of zero without complaint.
SPSS 14 seemed to output a measurement value of 0 for string variables,
but SPSS 21 does the same thing for numeric variables. We might as well
accept it.
Ben Pfaff [Sat, 3 Aug 2013 18:59:07 +0000 (11:59 -0700)]
sys-file-reader: Improve diagnostics for unexpected special values.
SPSS 21 schanged the value that it reports for "lowest" in the machine
float info record, but the existing diagnostics made it hard to tell
exactly what changed. Adding hexadecimal float output makes it obvious.
Ben Pfaff [Sun, 28 Jul 2013 22:24:39 +0000 (15:24 -0700)]
gui: Remove processor-area from status bar to reduce minimum window width.
Nothing ever puts anything in the processor-area widget, but it forces
the data window to be 35 character widths wider, so by removing it we can
allow the window to be resized much narrower when the status bar is shown.
Reported by Bastián Díaz <diaz.bastian@ymail.com>.