diff --git a/TablePlugin/data/System/TablePlugin.txt b/TablePlugin/data/System/TablePlugin.txt index 3b7785043b..1ad06d330d 100644 --- a/TablePlugin/data/System/TablePlugin.txt +++ b/TablePlugin/data/System/TablePlugin.txt @@ -116,6 +116,7 @@ Information for programmers. | Version: | %$VERSION% | | Release: | %$RELEASE% | | Change History: |   | +| 03 Sep 2009 | 1.041: Kenneth Lavrsen: Fix for crash when cell contains the number 0. Allow sorting of negative numbers even when suffixed with unit. Treat whitespace as zero if pure numerical context. | | 02 Sep 2009 | 1.040: Kenneth Lavrsen: Fixed the fix of parsing date-time columns so that plain numbers are not interpreted as dates causing wrong sorting | | 03 Jun 2009 | 1.039: Michael Daum: fixed parsing date-time columns | | 19 Apr 2009 | 1.038: Removed support for settings in the plugin topic which is a bad idea anyway as they get overwritten at each Foswiki upgrade. Define the global settings in %USERSWEB%.SitePreferences instead.
Fixed an issue where TablePlugin produced invalid css if no 'px' or '%' is passed in a size parameter.
Small refactoring in style attribute handling. | diff --git a/TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm b/TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm index 4543b0b705..e0cd42719c 100644 --- a/TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm +++ b/TablePlugin/lib/Foswiki/Plugins/TablePlugin.pm @@ -32,7 +32,7 @@ use Foswiki::Plugins (); # For the API version use vars qw( $topic $installWeb $initialised ); our $VERSION = '$Rev$'; -our $RELEASE = '1.040'; +our $RELEASE = '1.041'; our $SHORTDESCRIPTION = 'Control attributes of tables and sorting of table columns'; our $NO_PREFS_IN_TOPIC = 1; diff --git a/TablePlugin/lib/Foswiki/Plugins/TablePlugin/Core.pm b/TablePlugin/lib/Foswiki/Plugins/TablePlugin/Core.pm index ffbfbc3324..b96387b8ff 100644 --- a/TablePlugin/lib/Foswiki/Plugins/TablePlugin/Core.pm +++ b/TablePlugin/lib/Foswiki/Plugins/TablePlugin/Core.pm @@ -507,12 +507,12 @@ sub _convertToNumberAndDate { return (0, 0); } - my $num = 0; - my $date = 0; + my $num = undef; + my $date = undef; # Unless the table cell is a pure number # we test if it is a date. - if ( $text =~ /^\s*([0-9]+)(\.[0-9]+)?\s*$/ ) { + if ( $text =~ /^\s*-?[0-9]+(\.[0-9]+)?\s*$/ ) { $num = $text; } else { @@ -525,7 +525,7 @@ sub _convertToNumberAndDate { unless ($date) { $date = undef; - if ( $text =~ /^\s*([0-9]+)(\.[0-9]+)?/ ) { + if ( $text =~ /^\s*(-?[0-9]+)(\.[0-9]+)?/ ) { # for example for attachment sizes: 1.1 K # but also for other strings that start with a number my $num1 = $1 || 0; @@ -739,7 +739,7 @@ sub _guessColumnType { my $date = ''; my $columnIsValid = 0; foreach my $row (@curTable) { - next if ( !$row->[$col]->{text} ); + next if ( $row->[$col]->{text} =~ /^\s*$/ ); # else $columnIsValid = 1;