The subroutine
CALC()
separates its results by newlines (
\n
). That might
be Ok, but not so having a final newline at the end.
Here's the patch. Please test.
--- lib/TWiki/Plugins/SpreadSheetPlugin/Calc.pm (revision 12220)
+++ lib/TWiki/Plugins/SpreadSheetPlugin/Calc.pm (working copy)
@@ -72,7 +72,7 @@
$cPos = -1;
$rPos = -1;
- my $result = "";
+ my @result = ();
my $insidePRE = 0;
my $insideTABLE = 0;
my $line = "";
@@ -122,9 +122,9 @@
s/%CALC\{(.*?)\}%/&doCalc($1)/geo;
}
}
- $result .= "$_\n";
+ push @result, $_;
}
- $_[0] = $result;
+ $_[0] = join("\n", @result);
}
# =========================
@@ -690,6 +690,7 @@
} elsif( $theFunc eq "TIMEDIFF" ) {
my( $time1, $time2, $scale ) = split( /,\s*/, $theAttr, 3 );
+ $scale ||= '';
$time1 = 0 unless( $time1 );
$time2 = 0 unless( $time2 );
$time1 =~ s/.*?([0-9]+).*/$1/o || 0;
Fixes a "use of uninitialized blabla" warning along the way.
MD
Thanks, svn 12315.
--
PTh
4.1.0 released
KJL