John Darrington [Tue, 1 Dec 2015 17:35:50 +0000 (18:35 +0100)]
Vertically reflect the table borders for RTL locales
When rendering in a right to left locale, the terminals where a horizontal table
border line meets a vertical border needs to be a mirror image of what is normal
in a left to right locale. This change does that.
Reported by: Mohammad Haghighat <hosseinhg@hotmail.com>
John Darrington [Tue, 1 Dec 2015 13:30:09 +0000 (14:30 +0100)]
Output renderer: Reverse the order of table columns when in RTL locale
When operating in a RTL locale, the last column of a table should be rendered
"first" (ie. leftmost). This change achieves that. In order to determine if
the locale is a RTL locale, a new translatable string is introduced. This
string must be localised by the translator of the .po file for RTL locales. LTR
locales can leave it untranslated.
Reported by: Mohammad Haghighat <hosseinhg@hotmail.com>
osx: Test 605 (QUICK CLUSTER with pairwise missing) failed on Mac OS
The uses head -n -3 to check the top number of lines of two files. On osx
negative line numbers are not allowed with head. I changed this to the
respective number of positive line numbers.
osx: Test 172 (decrypt an encrypted syntax file) failed in regression
Test 172 decrypts a file which produces some problematic CRLF characters.
The characters are removed with sed to check vs. reference data, but the sed
does not work the same way on osx as on linux. I changed this to tr which
works on both systems.
Smake clean target removed po/ChangeLog and po/Makefile.in (both are in git)
make -f Smake clean
removed po/ChangeLog and po/Makefile.in which are under git control. This
fix leaves those two files untouched. Without the fix, the make -f Smake
step after a clean ends with an error because po/Makefile.in is missing.
John Darrington [Sat, 28 Nov 2015 06:55:01 +0000 (07:55 +0100)]
Persist dialog box widget settings.
Arrange for the status of widgets within dialog boxes to persist
between calls when called for the same dataset. Some users
have requested this to make repeated operations easier.
John Darrington [Wed, 18 Nov 2015 17:52:24 +0000 (18:52 +0100)]
Make fn_open and fn_close take a struct file_handle instead of char *
This change alters the signature of the fn_open and fn_close functions,
and changes all callers appropriately. The purpose of such a change is
so that the encoding of the filename is passed to fn_open from wherever
it was created.
It also changes the implementation of fn_open on windows systems to call
_wfopen instead of fopen. This should fix the problem of windows builds
not being able to open files whose pathnames included non-ascii characters.
As a bonus, we no longer require the rather contrived function
local_to_filename_encoding.
Some related issues (what about the pspprc file?) remain.
John Darrington [Fri, 13 Nov 2015 12:57:38 +0000 (13:57 +0100)]
QUICK CLUSTER: Remove sqrt from Euclidean distance calculations
The Euclidean distance is used only for comparison with other Euclidean
distances. Since it is invariant that (sqrt(x) < sqrt(y)) === (x < y)
for all non-negative x,y it is a waste of effort calculating the sqrt.
John Darrington [Sat, 7 Nov 2015 11:16:13 +0000 (12:16 +0100)]
Quick Cluster: Reimplement clustering algorithm
This change replaces the algorithm to be closer to that described by
SPSS Statistical Algorithms. It results in better classification of
"real" data, and better seperated cluster centers.
It also provides a few subcommands which were previously not
implemented.
John Darrington [Sat, 17 Oct 2015 15:29:31 +0000 (17:29 +0200)]
make-file.c: Behave better under windows operating systems
Under w32 it is necessary to convert all file names to UTF-16 and prefix all
the file related system calls with "_w". Otherwise, calls involving filenames
which contain non-ascii characters will not work properly.
John Darrington [Tue, 20 Oct 2015 10:08:46 +0000 (12:08 +0200)]
Append the correct number of null bytes to the end of recoded strings
Previously the recode_string et al functions assumed that the correct way to
terminate a string was to append a single \0. With encodings such as UTF-16
however, two \0 bytes are necessary and four with UTF-32. This change fixes
the problem.
John Darrington [Sat, 17 Oct 2015 16:04:10 +0000 (18:04 +0200)]
Add tests for cases exercising the atomic replacement mechanism
Add a test case when writing to a fifo.
Add some test cases for situations where file creation fails. Failure
to create a file should be reported gracefully.
John Darrington [Sun, 4 Oct 2015 20:54:48 +0000 (22:54 +0200)]
Zip Reader: Avoid undefined behaviour when reading short files
The zip reader makes many calls to fread. However the return value was not checked. This could
have had undefined consequences when reading short files. This change checks all calls to fread.
John Darrington [Wed, 16 Sep 2015 05:30:57 +0000 (07:30 +0200)]
Text file importer: Initialise the total_is_exact variable.
The text file importer was supposed to have a feature where the total number of lines
in the file was measured if the file was short, or estimated if it was long. However
the variable which was supposed to hold this information was never initialised. This
change fixes that.
John Darrington [Tue, 15 Sep 2015 16:17:19 +0000 (18:17 +0200)]
Ref count struct spreadsheet
struct spreadsheet is a base class for which all current derivations
are ref counted. It makes sense then to have the base class refcounted
instead of the more derived ones
John Darrington [Sat, 12 Sep 2015 10:38:50 +0000 (12:38 +0200)]
Fix dereference to reallocated pointer in data-parser.c (parse_delimited_no_span, parse_delimited_span)
The parse_delimited_span and parse_delimited_no_span functions were
accessing a pointer from within a loop, but the pointer had been
initialised outside the loop. However the loop itself was deallocating
the memory referenced by that pointer.
This change initialises the pointer within the loop so as to avoid
a potential crash here.
A number of users have complained that the import dialog assistant
crashes on exit. This seems to be because some callback is accessing
the data after it has been freed.
This change "fixes" that by simply not ever freeing the data. This
will cause a memory leak. However during my investigations, I have
found that this dialog leaks so much anyway that these few bytes are
hardly significant.
John Darrington [Mon, 17 Aug 2015 17:00:53 +0000 (19:00 +0200)]
Restore the splash screen.
Re-implementat the splash screen, using functinos which are not
deprecated under Gtk3. Note: This implementation does not
use the gtk functions which the Gtk devs recommend for splash screens.
What they forget, is that a primary purpose of a splash screen is
that it should appear with the minimum of delay. gtk_init can
have significant delay - hence the recommended way of doing splash
screens in Gtk is self defeating.
John Darrington [Sun, 26 Jul 2015 08:22:32 +0000 (10:22 +0200)]
PsppireDialogAction and subclasses - use function to set class activate and thus minimise deprecation warnings
All subclasses of PsppireDialogAction needed to use GtkActionClass. This widget however
is deprecated in recent Gtk versions. Meaning that all instances of PsppireDialogAction
implementations would provoke a deprecation warning at compile time.
This change avoids that by providing a common function to set GtkActionClass->activate.
Thus, there is now only a single warning instead of many.