pspp-builds.git
13 years agoCD: Fix a bug and add a regression test.
Ben Pfaff [Wed, 15 Jun 2011 05:38:13 +0000 (22:38 -0700)]
CD: Fix a bug and add a regression test.

13 years agoGET DATA /TYPE=TXT: Also allow full format to be specified.
Ben Pfaff [Wed, 15 Jun 2011 05:10:24 +0000 (22:10 -0700)]
GET DATA /TYPE=TXT: Also allow full format to be specified.

The implementation of fixed-format mode only allowed a format
type (e.g. DOLLAR) to be specified.  SPSS also allowed a full
format specification (e.g. DOLLAR12.2), so this implements that
feature.

Reported-by: Ronaldo Baltar <ronaldo.baltar@gmail.com>
13 years agotests: Remove unused old shell-based test files.
Ben Pfaff [Thu, 26 May 2011 17:48:09 +0000 (10:48 -0700)]
tests: Remove unused old shell-based test files.

Somehow I forgot to delete these when I switched everything over
to use Autotest.  Nothing refers to them any longer.

13 years agogui: Clean generated gtk.h wrapper on "make clean".
Ben Pfaff [Thu, 26 May 2011 04:31:33 +0000 (21:31 -0700)]
gui: Clean generated gtk.h wrapper on "make clean".

Fixes "make distcheck".

Reported by John Darrington.

13 years agogui: Fix temporary filtering by a variable's value.
Ben Pfaff [Sat, 14 May 2011 03:56:05 +0000 (20:56 -0700)]
gui: Fix temporary filtering by a variable's value.

Problem reported by Mindaugus.
Bug #33088.

13 years agogui: Make AGGREGATE dialog initially show all of the right pane.
Ben Pfaff [Fri, 13 May 2011 05:10:07 +0000 (22:10 -0700)]
gui: Make AGGREGATE dialog initially show all of the right pane.

The AGGREGATE dialog initially had a very narrow left pane, so
commit 2e6cffa44ef5 "Aggregate dialog: Initialize HPane widget width
on opening" added a callback function to adjust the position of the
divider between the panes to half the window's width.  But this
happens after the window has been laid out, which means that unless
the window is very wide to begin with, it will cause part of the
right pane to disappear.

I was able to get more consistently good results by forcing a minimum
width for the left pane with a width_request, and making the right
pane shrinkable below the minimum size needed to show all of it.  A
final tweak was to make the left pane automatically grow with the
window.

If you've already used the Aggregate dialog then your preferences for
the window size have been saved, so for testing this it is best to
remove $HOME/.config/psppire before each experiment.

Bug #31126.

13 years agoSORT CASES: Don't delete filtered-out cases.
Ben Pfaff [Fri, 13 May 2011 05:55:29 +0000 (22:55 -0700)]
SORT CASES: Don't delete filtered-out cases.

This was first noticed by users in the GUI, but it is a problem with
the implementation of SORT CASES, not a problem with the GUI.

Bug #33089.
Thanks to Mindaugus for reporting the problem.

13 years agogui: Make File|Recent Files remember the correct encoding.
Ben Pfaff [Thu, 12 May 2011 05:36:45 +0000 (22:36 -0700)]
gui: Make File|Recent Files remember the correct encoding.

It's no good to have File|Open... able to open a file in any encoding
if later pulling up the same file with File|Recent Files screws that
up, so this commit fixes the problem by noting the charset in the
file's mime-type.

13 years agogui: Recode syntax files on load and save.
Ben Pfaff [Fri, 13 May 2011 04:07:12 +0000 (21:07 -0700)]
gui: Recode syntax files on load and save.

This adds a new widget that allows an encoding to be selected to the
File|Open dialog box, as well as to the File|Save As... dialog box
for syntax files only.  Files are recoded to UTF-8 on load and back
to the original encoding on save.

File|Recent Files doesn't yet properly save the encoding information.
That's coming up in the next commit.

Bug #33254.
Thanks to John Darrington for reporting this problem.

13 years agogui: Refactor checking for .sav and .por suffixes.
Ben Pfaff [Thu, 12 May 2011 05:38:57 +0000 (22:38 -0700)]
gui: Refactor checking for .sav and .por suffixes.

It seems reasonable to allow, e.g., .Sav as well as .SAV and .sav, so
this does that.  It also splits name_has_suffix() into smaller
pieces that will individually be used in an upcoming commit.

13 years agogui: Move null_if_empty_param() from psppire-window to helper.
Ben Pfaff [Thu, 12 May 2011 05:27:00 +0000 (22:27 -0700)]
gui: Move null_if_empty_param() from psppire-window to helper.

An upcoming commit will introduce a new user of this function in a
different source file, so it seems best to have this defined in a
common header file.

13 years agoi18n: New function is_encoding_supported().
Ben Pfaff [Thu, 12 May 2011 05:25:35 +0000 (22:25 -0700)]
i18n: New function is_encoding_supported().

This will be used for the first time in an upcoming commit.

13 years agoencoding-guesser: New function encoding_guess_whole_file().
Ben Pfaff [Thu, 12 May 2011 05:24:59 +0000 (22:24 -0700)]
encoding-guesser: New function encoding_guess_whole_file().

This will be used for the first time in an upcoming commit.

13 years agopspp-dump-sav: Add #include <limits.h> to get INT_MAX definition.
Ben Pfaff [Thu, 12 May 2011 03:21:38 +0000 (20:21 -0700)]
pspp-dump-sav: Add #include <limits.h> to get INT_MAX definition.

Problem reported by Harry Thijssen <pspp@sjpaes.nl>.

13 years agoconfigure: Use $LIB<x> for linking a program, not $LTLIB<x>.
Ben Pfaff [Thu, 12 May 2011 02:31:22 +0000 (19:31 -0700)]
configure: Use $LIB<x> for linking a program, not $LTLIB<x>.

The gettext manual says:

     `@LIBINTL@' is for use without `libtool', `@LTLIBINTL@' is for
     use with `libtool'

It has similar wording for libiconv.

Since there's lots of libtool-related stuff in the PSPP makefiles, I
assumed that PSPP needed $LTLIB<x>.  But it now appears that this is
only correct for linking a libtool library, not for linking a
program that links against libtool libraries.

On GNU/Linux, both $LIB<x> and $LTLIB<x> expand to the empty string,
so I couldn't tell from experimenting there.

This should fix link failures with Mingw, reported by Harry Thijssen
<pspp@sjpaes.nl>.

13 years agopspp-dump-sav: Add GNU standards compliant command line interface.
Ben Pfaff [Wed, 11 May 2011 05:21:59 +0000 (22:21 -0700)]
pspp-dump-sav: Add GNU standards compliant command line interface.

13 years agopspp-dump-sav: Do not mark any strings for translation.
Ben Pfaff [Wed, 11 May 2011 05:14:23 +0000 (22:14 -0700)]
pspp-dump-sav: Do not mark any strings for translation.

The pspp-dump-sav program is a debugging tool not intended for common
use by end users, so it seems better to avoid burdening translators
with its strings.

13 years agopspp-dump-sav: Update #include syntax to current style.
Ben Pfaff [Wed, 11 May 2011 04:58:34 +0000 (21:58 -0700)]
pspp-dump-sav: Update #include syntax to current style.

13 years agodissect-sysfile: Move to new "utilities" directory as "pspp-dump-sav".
Ben Pfaff [Wed, 11 May 2011 04:35:44 +0000 (21:35 -0700)]
dissect-sysfile: Move to new "utilities" directory as "pspp-dump-sav".

This utility comes in handy from time to time working with end users,
so I think it's best to start installing it with the other binaries,
instead of hiding it in the "tests" directory and having to explain
where to find it.

13 years agoAutomatically link every program against libintl and libiconv.
Ben Pfaff [Tue, 10 May 2011 22:57:44 +0000 (15:57 -0700)]
Automatically link every program against libintl and libiconv.

On glibc systems, libiconv and libintl are both built into libc.  That
means that it's very easy to forget to link programs against them,
because it still builds OK on GNU/Linux.  However, on other systems
they are usually separate libraries and forgetting to link against
them breaks the build.

This commit switches from previous PSPP practice, in which these
libraries were linked explicitly to every binary that requires them,
to a simplified practice where they are in LIBS so that every binary
is automatically linked to them.  This has no disadvantage on
GNU/Linux, our primary target, and the advantage that on other targets
PSPP works more consistently.

13 years agogui: Get rid of the_recent_manager global.
Ben Pfaff [Tue, 10 May 2011 05:42:37 +0000 (22:42 -0700)]
gui: Get rid of the_recent_manager global.

The GTK+ function gtk_recent_manager_get_default() is documented to
return a singleton.  We might as well take advantage of that instead
of caching its return value and passing it around.

13 years agopo: Update Dutch translation from translation-project.org.
Ben Pfaff [Tue, 10 May 2011 23:00:32 +0000 (16:00 -0700)]
po: Update Dutch translation from translation-project.org.

13 years agogui: Delete now-incorrect advice to translators.
Ben Pfaff [Tue, 10 May 2011 04:42:06 +0000 (21:42 -0700)]
gui: Delete now-incorrect advice to translators.

The string to which the advice applied was deleted, but the comment
was mistakenly left behind.

13 years agogui: Make File|Recently Used Data behave like File|Open.
Ben Pfaff [Mon, 9 May 2011 04:52:08 +0000 (21:52 -0700)]
gui: Make File|Recently Used Data behave like File|Open.

File|Open opens a new dataset if the current one is non-empty.  Due
to an oversight, File|Recently Used Data always replaced the current
dataset.  This commit makes File|Recently Used Data work just like
File|Open.

13 years agogui: Remove redundant call to psppire_window_set_title().
Ben Pfaff [Mon, 9 May 2011 04:38:41 +0000 (21:38 -0700)]
gui: Remove redundant call to psppire_window_set_title().

13 years agogui: Make File|Open open multiple datasets by default.
Ben Pfaff [Mon, 9 May 2011 04:17:51 +0000 (21:17 -0700)]
gui: Make File|Open open multiple datasets by default.

This is what I always intended to make File|Open do, and in fact I
had implemented it that way, but I screwed up in rebasing and forgot
to fix it before my final push.

13 years agopsppire-sheet: Avoid CRITICAL unselecting range before window created.
Ben Pfaff [Mon, 9 May 2011 04:24:17 +0000 (21:24 -0700)]
psppire-sheet: Avoid CRITICAL unselecting range before window created.

Without this change, File|Open that opens a new datasheet yields:

Gdk-CRITICAL **: gdk_window_invalidate_rect_full: assertion
`GDK_IS_WINDOW (window)' failed

I'm not 100% certain that this is the correct fix--perhaps the client
is at fault for calling this function before a window exists?--but it
does avoid the message.

13 years agogui: Avoid creating empty output window at startup time.
Ben Pfaff [Sun, 8 May 2011 05:03:31 +0000 (22:03 -0700)]
gui: Avoid creating empty output window at startup time.

Reported by Harry Thijssen.
Bug #33234.

13 years agogui: Label message output items in the output viewer treeview.
Ben Pfaff [Sun, 8 May 2011 05:02:25 +0000 (22:02 -0700)]
gui: Label message output items in the output viewer treeview.

Until now, messages (such as errors and warnings) simply had blank
lines in the output viewer summary treeview.  This made for funny gaps
and a generally puzzling appearance.  This fixes the problem.

13 years agogui: Only unselect range from first data sheet when data changes.
Ben Pfaff [Sat, 7 May 2011 21:19:12 +0000 (14:19 -0700)]
gui: Only unselect range from first data sheet when data changes.

commit 5080068 "gui: Unselect data in data editor when the datasheet
is replaced" unselected all the data in each of the possible four
datasheets (supposing that the "split" view is selected), but if the
"split" view is not in effect then three of the data sheets don't have
windows and this results in "Gdk-CRITICAL **:
gdk_window_invalidate_rect_full: assertion `GDK_IS_WINDOW (window)'
failed".

This commit switches to unselecting the range only from the first data
sheet, which seems to be just as effective at solving the original
problem and does not cause Gdk-CRITICAL messages.

13 years agoext-array: Speed up with unlocked versions of I/O functions.
Ben Pfaff [Sat, 7 May 2011 20:02:34 +0000 (13:02 -0700)]
ext-array: Speed up with unlocked versions of I/O functions.

In my tests this reduced a 2.0 second run to only 1.5 seconds.

Bug #33260.

13 years agotemp-file: Use 64 kB buffer for temporary files.
Ben Pfaff [Sat, 7 May 2011 20:01:02 +0000 (13:01 -0700)]
temp-file: Use 64 kB buffer for temporary files.

Generally PSPP uses temporary files because it has a lot of data to
write to them.  The default glibc buffer is only 4 kB.  In my tests
using a 64 kB reduced runtime from 2.5 seconds to 2.0 seconds, but
increasing the buffer to 1 MB had no additional effect, so 64 kB is a
reasonable choice.

Bug #33260.

13 years agocairo: Left-justify text items rendered in the GUI.
Ben Pfaff [Sat, 7 May 2011 18:55:22 +0000 (11:55 -0700)]
cairo: Left-justify text items rendered in the GUI.

Otherwise multi-line syntax comes out right-justified, which looks
really funny.

Bug #33261.

13 years agogui: Use GTK+ accessor functions instead of deprecated macros.
Ben Pfaff [Sat, 7 May 2011 17:35:47 +0000 (10:35 -0700)]
gui: Use GTK+ accessor functions instead of deprecated macros.

These are now available on all GTK+ versions due to the <gtk/gtk.h>
wrapper added in the previous commit.

13 years agogui: Add <gtk/gtk.h> wrapper with functions from GTK+ 2.18 and 2.20.
Ben Pfaff [Sat, 7 May 2011 17:25:44 +0000 (10:25 -0700)]
gui: Add <gtk/gtk.h> wrapper with functions from GTK+ 2.18 and 2.20.

Suggested by John Darrington.

13 years agodataset: Fix memory leak.
Ben Pfaff [Sat, 7 May 2011 16:37:00 +0000 (09:37 -0700)]
dataset: Fix memory leak.

Reported by John Darrington.

13 years agogui: Add workaround for GTK+ 2.20 crash at startup.
Ben Pfaff [Sat, 7 May 2011 16:32:09 +0000 (09:32 -0700)]
gui: Add workaround for GTK+ 2.20 crash at startup.

Based on this patch against Inkscape:
https://launchpadlibrarian.net/60175914/copy_renamed_icons.patch

Reported by Fredrik Clementz.
With input from John Darrington and Harry Thijssen.
Tested by Mindaugus.
Bug #31511.

13 years agogui: Provide substitute for gtk_widget_get_realized() for GTK+ < 2.20.
Ben Pfaff [Sat, 7 May 2011 03:56:18 +0000 (20:56 -0700)]
gui: Provide substitute for gtk_widget_get_realized() for GTK+ < 2.20.

Problem reported by "Mindaugas Baranauskas" <embar@super.lt>.

13 years agopo: Update Dutch translation from translation-project.org.
Ben Pfaff [Fri, 6 May 2011 16:03:28 +0000 (09:03 -0700)]
po: Update Dutch translation from translation-project.org.

13 years agoUpdated the Lithuanian translation from http://translationproject.org.
Ben Pfaff [Fri, 6 May 2011 03:05:18 +0000 (20:05 -0700)]
Updated the Lithuanian translation from translationproject.org.

13 years agointern: Fix GCC warning.
Ben Pfaff [Thu, 5 May 2011 04:16:39 +0000 (21:16 -0700)]
intern: Fix GCC warning.

Otherwise, GCC issues the following warning:

intern.c:83: warning: comparison of distinct pointer types lacks a
cast.

13 years agogui: Unselect data in data editor when the datasheet is replaced.
Ben Pfaff [Wed, 4 May 2011 04:30:01 +0000 (21:30 -0700)]
gui: Unselect data in data editor when the datasheet is replaced.

The active cell in the PsppireSheet remembers its contents even if
the whole sheet gets replaced, so we have to unselect the cell when
this happens to avoid replacing the cell's contents by whatever was
there before.

Bug #30502.
Thanks to Michel Boaventura for reporting the problem and John
Darrington for diagnosing it.

13 years agoIncrement version to 0.7.8 to send to Translation Project. v0.7.8
Ben Pfaff [Thu, 5 May 2011 01:51:34 +0000 (18:51 -0700)]
Increment version to 0.7.8 to send to Translation Project.

13 years agopsql-reader: Fix build when PostgreSQL is installed.
Ben Pfaff [Wed, 4 May 2011 04:53:17 +0000 (21:53 -0700)]
psql-reader: Fix build when PostgreSQL is installed.

Problem reported by "Mindaugas Baranauskas" <embar@super.lt>.

13 years agoNEWS: Consolidate post-0.6.2 NEWS.
Ben Pfaff [Wed, 4 May 2011 04:10:10 +0000 (21:10 -0700)]
NEWS: Consolidate post-0.6.2 NEWS.

Suggested by John Darrington.

13 years agogui: Change View|Data and View|Variables to radio button menu items.
Ben Pfaff [Sun, 1 May 2011 05:30:28 +0000 (22:30 -0700)]
gui: Change View|Data and View|Variables to radio button menu items.

I didn't know what View|Variables did until I tried it, at which
point I was surprised that it changed into View|Data.  I think that
a pair of radio button menu items better communicates the intent.
Also, this situation seems to fit well what the GNOME Human Interface
Guidelines say about radio button menu items:

    Radio button menu items show which of two or more
    mutually-exclusive settings are currently selected, and allow
    the user to choose a different setting by selecting its menu
    item.

    * If you need to offer a choice of two mutually-exclusive
      settings to the user, use a group of two radio button items
      instead of a single check box menu item if the settings are
      not clearly opposites. For example, represent View as Icons
      and View as List as two radio button items.

13 years agogui: Add ellipsis to menu items that require further input.
Ben Pfaff [Sun, 1 May 2011 05:00:33 +0000 (22:00 -0700)]
gui: Add ellipsis to menu items that require further input.

The GNOME Human Interface Guidelines say:

    Label the menu item with a trailing ellipsis ("...") only if
    the command requires further input from the user before it
    can be performed. Do not add an ellipsis to items that only
    present a confirmation dialog (such as Delete), or that do
    not require further input (such as Properties, Preferences or
    About).

Most PSPPIRE menu items fit this description, so they should have
trailing ellipses, which this commit adds.

Some GTK+ programs use the Unicode HORIZONTAL ELLIPSIS (U+2026)
character instead of three periods in menu items.  In a quick check
on my own machine, however, three periods were over twice as common.
In an informal survey on pspp-dev, the best argument presented in
favor of one or the other was that three periods may be more familiar
for translators and thus cause less confusion in translation.

13 years agoImplement DATASET commands.
Ben Pfaff [Sat, 30 Apr 2011 04:45:15 +0000 (21:45 -0700)]
Implement DATASET commands.

13 years agogui: New "entry-dialog" module for prompting for a text string.
Ben Pfaff [Sun, 1 May 2011 04:08:01 +0000 (21:08 -0700)]
gui: New "entry-dialog" module for prompting for a text string.

This will be used in an upcoming commit to implement File|Rename
Dataset.  It is made general-purpose, rather than specifically
for that purpose, because it is not any harder to do so and might
be useful somewhere else in the future.

13 years agopsppire-buttonbox: Add "default" property.
Ben Pfaff [Tue, 3 May 2011 13:47:24 +0000 (06:47 -0700)]
psppire-buttonbox: Add "default" property.

This property allows the default button to be controlled from a
GtkBuilder description, instead of forcing the default to Continue.

Only a single bit should be set in the "default" mask.

13 years agogui: Fix g_object_get() memory leaks for PsppireWindow's filename.
Ben Pfaff [Mon, 4 Apr 2011 05:02:47 +0000 (22:02 -0700)]
gui: Fix g_object_get() memory leaks for PsppireWindow's filename.

g_object_get() makes a copy of strings that it returns, so every call
for "filename" was returning a copied string that the caller did not
free.

13 years agogui: Fix File|Open in syntax editor.
Ben Pfaff [Fri, 29 Apr 2011 04:12:27 +0000 (21:12 -0700)]
gui: Fix File|Open in syntax editor.

It didn't do anything.

13 years agogui: Eliminate dataset-related global variables.
Ben Pfaff [Fri, 29 Apr 2011 13:59:55 +0000 (06:59 -0700)]
gui: Eliminate dataset-related global variables.

This should make it easier to introduce support for multiple datasets
later.

13 years agogui: Make syntax execution functions take a PsppireDataWindow argument.
Ben Pfaff [Wed, 30 Mar 2011 04:29:13 +0000 (21:29 -0700)]
gui: Make syntax execution functions take a PsppireDataWindow argument.

The argument specifies which dataset the syntax is meant to apply to.
For now, this is obvious, because there is only one dataset, but in
the future there will be more than one.

13 years agogui: Prefer NULL to 0 for initializing pointers.
Ben Pfaff [Wed, 8 Sep 2010 04:51:03 +0000 (21:51 -0700)]
gui: Prefer NULL to 0 for initializing pointers.

Using NULL instead of 0 is better modern C style.

13 years agogui: Remove obviously unnecessary #include directives.
Ben Pfaff [Wed, 8 Sep 2010 04:44:46 +0000 (21:44 -0700)]
gui: Remove obviously unnecessary #include directives.

These simple header files #include <gtk/gtk.h> but do not reference
anything from GTK+, so they do not to #include its header.

13 years agogui: Include only <gtk/gtk.h> to use GTK+.
Ben Pfaff [Wed, 8 Sep 2010 04:40:40 +0000 (21:40 -0700)]
gui: Include only <gtk/gtk.h> to use GTK+.

The GTK+ manual says: "The recommended way of using GTK+ has always been
to only include the toplevel headers gtk.h, gdk.h, gdk-pixbuf.h."  We
might as well follow this practice, since it only makes life easier.

13 years agopsppire-window: Use g_string_append_unichar() instead of global var.
Ben Pfaff [Mon, 4 Apr 2011 00:24:26 +0000 (17:24 -0700)]
psppire-window: Use g_string_append_unichar() instead of global var.

Seems slightly cleaner.

13 years agogui: Use dispose instead of finalize method in PsppireDataWindow.
Ben Pfaff [Sat, 2 Apr 2011 04:14:49 +0000 (21:14 -0700)]
gui: Use dispose instead of finalize method in PsppireDataWindow.

According to the GObject reference manual, "When dispose ends, the
object should not hold any reference to any other member object."
That is, references should be dropped in dispose, not in finalize.

13 years agogui: Drop null base_finalize function from PsppireDataWindow.
Ben Pfaff [Wed, 30 Mar 2011 04:51:42 +0000 (21:51 -0700)]
gui: Drop null base_finalize function from PsppireDataWindow.

According to the GObject manual, base_finalize is "Never used in
practice. Unlikely you will need it." so I don't see a reason to keep
a stub here.

13 years agogui: Fix const-ness warning in create_lines_tree_view().
Ben Pfaff [Sat, 2 Apr 2011 04:12:54 +0000 (21:12 -0700)]
gui: Fix const-ness warning in create_lines_tree_view().

This fixes this warning from GCC:

src/ui/gui/text-data-import-dialog.c: In function ‘create_lines_tree_view’:
src/ui/gui/text-data-import-dialog.c:875: warning: initialization
discards qualifiers from pointer target type

13 years agogui: Fix const-ness warning for measure_to_string() return type.
Ben Pfaff [Sat, 2 Apr 2011 04:11:47 +0000 (21:11 -0700)]
gui: Fix const-ness warning for measure_to_string() return type.

This fixes the following GCC warning:

src/ui/gui/var-display.c: In function ‘measure_to_string’:
rc/ui/gui/var-display.c:25: warning: return discards qualifiers from
pointer target type

13 years agogui: Put a separator line before list of windows in Windows menus.
Ben Pfaff [Wed, 6 Apr 2011 04:30:34 +0000 (21:30 -0700)]
gui: Put a separator line before list of windows in Windows menus.

I found it a bit confusing before, that the list of windows in the
Windows menu was not separated from the list of actions of windows.
This fixes the problem.

Simply adding a separator item to the .ui files doesn't work, because
GtkUIManager removes it.  The same thing happens if we add a separator
without adding a real menu item at the same time.

Thanks to John Darrington for suggesting the root of the problem.

13 years agogui: Always convert file names to UTF-8 for use in syntax.
Ben Pfaff [Thu, 31 Mar 2011 04:39:01 +0000 (21:39 -0700)]
gui: Always convert file names to UTF-8 for use in syntax.

Syntax as understood by the lexer is always in UTF-8, so file names
have to be in UTF-8 too.  (The PSPP code that opens files based on
strings from syntax is already using utf8_to_filename() to convert
them properly before opening.)

Before commit 9ade26c8349 "lexer: Reimplement for better
testability and internationalization", the encoding of syntax
files was not well-defined.  It was reasonable, then, to put file
names in generated syntax in the file name encoding.

Commit 9ade26c8349 changed the encoding of syntax so that it was
always in UTF-8.  This meant that file names in syntax had to be
converted back into the file name encoding before trying to open
the files, and I made that change (you can see, for example, the
call to utf8_to_filename in do_insert() in
src/language/utilities/include.c).  But I forgot that the GUI
needs to convert its file names into UTF-8 when it is generating
syntax, so this commit fixes that up.

13 years agopo: Update Spanish translation from translation-project.org.
Ben Pfaff [Tue, 3 May 2011 04:01:35 +0000 (21:01 -0700)]
po: Update Spanish translation from translation-project.org.

13 years agopo: Update Catalan translation from translation-project.org.
Ben Pfaff [Tue, 3 May 2011 04:01:23 +0000 (21:01 -0700)]
po: Update Catalan translation from translation-project.org.

13 years agoFACTOR: Use %s for literal string.
Ben Pfaff [Wed, 27 Apr 2011 04:53:26 +0000 (21:53 -0700)]
FACTOR: Use %s for literal string.

tab_title() treats its parameter as a printf format string, so it's
necessary to use %s.

Found on Mac OS X with help from Jeremy Lavergne.

13 years agoUse %zu, not %d, to format a size_t.
Ben Pfaff [Wed, 27 Apr 2011 04:52:27 +0000 (21:52 -0700)]
Use %zu, not %d, to format a size_t.

Found on Mac OS X with help from Jeremy Lavergne.

13 years agoencoding-guesser: Don't guess UTF-8 for ASCII if it is the fallback.
Ben Pfaff [Wed, 27 Apr 2011 04:36:24 +0000 (21:36 -0700)]
encoding-guesser: Don't guess UTF-8 for ASCII if it is the fallback.

When the text presented to the encoding guesser is all ASCII, normally
the encoding guesser will report ASCII as its guess.  But if the
fallback encoding is UTF-8, then it reports UTF-8 instead.
Unfortunately, this makes the encoding guesser a bit harder to test,
because guesses depend on the system's locale.  It's easier to test
if all-ASCII always yields ASCII as the guess, so this changes the
encoding guesser to do that.

This fixes a test failure on Mac OS X.  Thanks to Jeremy Lavergne for
reporting the problem.

13 years agoi18n: Fix type of objects passed as u8_mbtouc()'s character parameter.
Ben Pfaff [Wed, 27 Apr 2011 04:22:41 +0000 (21:22 -0700)]
i18n: Fix type of objects passed as u8_mbtouc()'s character parameter.

Thanks to Jeremy Lavergne for making a Mac OS build system available.

13 years agoQUICK CLUSTER: Adjust comment style.
Ben Pfaff [Tue, 26 Apr 2011 03:06:19 +0000 (20:06 -0700)]
QUICK CLUSTER: Adjust comment style.

PSPP uses primarily /**/ style comments so the use of // comments in
this file sticks out.

Also we generally wrap comments (and code) at 79 columns and try to
write comments as whole sentences, at least where there is room.

Also, usually PSPP avoids multiple blank lines in a row.

13 years agoQUICK CLUSTER: Update #include directives to match current style.
Ben Pfaff [Tue, 26 Apr 2011 02:59:01 +0000 (19:59 -0700)]
QUICK CLUSTER: Update #include directives to match current style.

These days, usually system header files are #included first, using
<> notation, and then PSPP's one header files, using "" notation.
Each group is alphabetized.

13 years agoQUICK CLUSTER: Fold quick-cluster.h into quick-cluster.c.
Ben Pfaff [Tue, 26 Apr 2011 02:56:42 +0000 (19:56 -0700)]
QUICK CLUSTER: Fold quick-cluster.h into quick-cluster.c.

It's unusual to put 'static' function prototypes into a header file:
header files are usually used to export declarations for use by other
source files, but 'static' functions cannot be called outside their
own source files.

13 years agoQUICK CLUSTER: New command.
Mehmet Hakan Satman [Tue, 26 Apr 2011 02:53:15 +0000 (19:53 -0700)]
QUICK CLUSTER: New command.

13 years agosys-file: Add test to write non-ASCII to most .sav string fields.
Ben Pfaff [Tue, 26 Apr 2011 04:37:18 +0000 (21:37 -0700)]
sys-file: Add test to write non-ASCII to most .sav string fields.

Bug #33036.

13 years agosys-file-reader: Add tests for non-ASCII characters and encodings.
Ben Pfaff [Mon, 25 Apr 2011 04:42:54 +0000 (21:42 -0700)]
sys-file-reader: Add tests for non-ASCII characters and encodings.

13 years agoDISPLAY FILE LABEL: Display in a more natural way.
Ben Pfaff [Mon, 25 Apr 2011 04:41:30 +0000 (21:41 -0700)]
DISPLAY FILE LABEL: Display in a more natural way.

13 years agoMRSETS: Recode counted value to UTF-8 before displaying.
Ben Pfaff [Mon, 25 Apr 2011 04:41:02 +0000 (21:41 -0700)]
MRSETS: Recode counted value to UTF-8 before displaying.

Otherwise they display incorrectly if a counted value contains
non-ASCII characters.

13 years agosys-file-reader, sys-file-writer: Fix encoding problems for mrsets.
Ben Pfaff [Sun, 24 Apr 2011 20:19:15 +0000 (13:19 -0700)]
sys-file-reader, sys-file-writer: Fix encoding problems for mrsets.

13 years agosys-file-writer: Fix encoding of several string fields.
Ben Pfaff [Sun, 24 Apr 2011 03:15:18 +0000 (20:15 -0700)]
sys-file-writer: Fix encoding of several string fields.

PSPP keeps most string data in the dictionary in UTF-8.  The system
file writer needs to recode this data into the correct encoding, but
in several cases it failed to do so.  This fixes the problem.

Thanks to Mindaugas for reporting the problem and to John Darrington
for help diagnosing it.

Bug #33036.

13 years agosys-file-reader: Take string encoding into account for text records.
Ben Pfaff [Sun, 24 Apr 2011 05:10:20 +0000 (22:10 -0700)]
sys-file-reader: Take string encoding into account for text records.

The 'encoding' member of struct sfm_reader was not filled in anywhere,
so it was always NULL, which meant that the recode operation in
open_text_record() was a no-op.

13 years agovariable: Make var_set_label() use the variable's own encoding.
Ben Pfaff [Sun, 24 Apr 2011 04:45:19 +0000 (21:45 -0700)]
variable: Make var_set_label() use the variable's own encoding.

I don't see any reason to make the caller supply this.  It just makes
code harder to read and write.

13 years agodictionary: Make dict_create() take the new dictionary's encoding.
Ben Pfaff [Sun, 24 Apr 2011 04:40:48 +0000 (21:40 -0700)]
dictionary: Make dict_create() take the new dictionary's encoding.

There are several places in the PSPP tree that create dictionaries,
but few of them actually set an encoding.  This causes most
dictionaries to be in the default encoding, which is often not
correct.

By making dict_create() take the encoding as a parameter we force
the caller to think about the encoding issue up-front.

13 years agodictionary: Set encoding early when cloning a dictionary.
Ben Pfaff [Sat, 23 Apr 2011 19:01:35 +0000 (12:01 -0700)]
dictionary: Set encoding early when cloning a dictionary.

Many operations that involve the names of variables and other entities
in a dictionary depend on the dictionary's encoding, so it is
potentially important to have the encoding set properly when adding
other entities to the dictionary.

I did not check that this fixes an actual bug.

13 years agoshort-names: Consider character encoding when making short names.
Ben Pfaff [Sat, 23 Apr 2011 18:59:49 +0000 (11:59 -0700)]
short-names: Consider character encoding when making short names.

Variable names and short names are always in UTF-8, but the length of
short names needs to be limited to 8 bytes in the dictionary encoding,
not in UTF-8.  This commit fixes that problem.

13 years agoshort-names: Drop redundant call to var_set_short_name().
Ben Pfaff [Sat, 23 Apr 2011 18:40:42 +0000 (11:40 -0700)]
short-names: Drop redundant call to var_set_short_name().

This function always calls var_set_short_name() twice, so we can drop
the first call.

13 years agodissect-sysfile: Don't omit the last in a series of text tokens.
Ben Pfaff [Sun, 24 Apr 2011 04:59:38 +0000 (21:59 -0700)]
dissect-sysfile: Don't omit the last in a series of text tokens.

Otherwise dissect-sysfile would not print the last long string
variable name written by sys-file-writer, because it did not include
a separator byte after the last record.  (This was obvious running
dissect-sysfile on a system file with only one variable.)

13 years agostr: Always null-terminate string in str_format_26adic().
Ben Pfaff [Sat, 23 Apr 2011 19:02:04 +0000 (12:02 -0700)]
str: Always null-terminate string in str_format_26adic().

It seems like a good idea to always supply a null terminator, even on
error.

13 years agoReformat src/language/stats/automake.mk.
Ben Pfaff [Tue, 26 Apr 2011 01:28:20 +0000 (18:28 -0700)]
Reformat src/language/stats/automake.mk.

It seems more consistent with most of our Makefiles to just write one
file per line.

13 years agoUpdated the Lithuanian translation from http://translationproject.org.
Ben Pfaff [Sat, 23 Apr 2011 18:00:49 +0000 (11:00 -0700)]
Updated the Lithuanian translation from translationproject.org.

13 years agoSmake: Add unilbrk/u8-possible-linebreaks Gnulib module.
Ben Pfaff [Sat, 23 Apr 2011 14:54:56 +0000 (07:54 -0700)]
Smake: Add unilbrk/u8-possible-linebreaks Gnulib module.

The ASCII output driver now requires this module, as of commit
14b3603043 "ascii: Add support for multibyte characters."

Reported by John Darrington.

13 years agoAdd new output/ascii.h header to the distribution, fixing "make dist".
Ben Pfaff [Sat, 23 Apr 2011 14:53:00 +0000 (07:53 -0700)]
Add new output/ascii.h header to the distribution, fixing "make dist".

13 years agoascii: Print syntax in output single-spaced.
Ben Pfaff [Sat, 23 Apr 2011 05:29:19 +0000 (22:29 -0700)]
ascii: Print syntax in output single-spaced.

When SET PRINTBACK=ON was in effect, the ASCII output driver would
put a blank line between successive lines of syntax, because each line
was output separately.  This commit fixes that, by causing the output
core to combine successive syntax output items into a single item that
contains multiple lines of text.  This was essentially what the HTML
output driver was doing anyhow, so putting this into the core also
allows removing the corresponding logic from the HTML driver.

13 years agoascii: Don't print command names in output.
Ben Pfaff [Sat, 23 Apr 2011 05:10:04 +0000 (22:10 -0700)]
ascii: Don't print command names in output.

This seems to be closer to what users expect.

I think that having the command names in output was being confused
by users with SET PRINTBACK=ON (see e.g. bug #31561) even though I
really just added that so that there are clear titles for the output
that goes with each procedure.  This change should help, I think.

It might make sense to make drivers only print the titles of
procedures that have other output, but this commit doesn't do that.

13 years agoodt: Write command name in output both only before command, not after.
Ben Pfaff [Sat, 23 Apr 2011 05:07:52 +0000 (22:07 -0700)]
odt: Write command name in output both only before command, not after.

13 years agoascii: Add support for multibyte characters.
Ben Pfaff [Sat, 23 Apr 2011 03:21:57 +0000 (20:21 -0700)]
ascii: Add support for multibyte characters.

This commit modifies render.at, changing hyphens to non-breaking
hyphens.  This change is only to ensure that the output for the tests
in render.at are the same afterward.  Without these changes, these
tests wrap these tables differently, because they break after the
hyphens; before, only spaces were considered valid breakpoints.

Bug #31478.

13 years agoascii: Drop useless 'wrap_mode' parameter from ascii_layout_cell().
Ben Pfaff [Sun, 17 Apr 2011 01:43:56 +0000 (18:43 -0700)]
ascii: Drop useless 'wrap_mode' parameter from ascii_layout_cell().

This parameter is always supplied as WRAP_WORD, so there's no point
in having it at all.

13 years agoUpdated the Lithuanian translation from http://translationproject.org.
Ben Pfaff [Sun, 17 Apr 2011 23:55:09 +0000 (16:55 -0700)]
Updated the Lithuanian translation from translationproject.org.

13 years agogui: Add Lithuanian translation and MIME type to pspp.desktop
Mindaugas [Sun, 17 Apr 2011 23:52:41 +0000 (16:52 -0700)]
gui: Add Lithuanian translation and MIME type to pspp.desktop

13 years agoUpdated the Lithuanian translation from http://translationproject.org.
Ben Pfaff [Sat, 16 Apr 2011 20:40:43 +0000 (13:40 -0700)]
Updated the Lithuanian translation from translationproject.org.