*** SpreadSheetPlugin.pm.orig 2005-05-03 18:20:07.000000000 +0200 --- SpreadSheetPlugin.pm 2005-04-29 15:16:40.000000000 +0200 *************** *** 606,611 **** --- 606,638 ---- } $result =~ s|
$||o; + } elsif( $theFunc eq "SUMITEMS" ) { + $result = ""; + my( $t, $v ) = _properSplit( $theAttr, 2); + my @tags = getList( $t ); + my @vals = getListAsFloat( $v ); + my %items = (); + my $key = ""; + for $i (0 .. $#tags ) { + $key = $tags[$i]; + $key =~ s/^\s*(.*?)\s*$/$1/o if( $key ); + if( $key ) { + if( exists( $items{ $key } ) ) { + $items{ $key } = $items{ $key }+$vals[$i]; + } else { + $items{ $key } = $vals[$i]; + } + } + } + + $result=""; + foreach $key ( sort keys %items ) { + $result .= ""; + } + $result .= "
$key $items{ $key }
"; + + $result =~ s|
$||o; + } elsif( $theFunc =~ /^(FIND|SEARCH)$/ ) { my( $searchString, $string, $pos ) = split( /,\s*/, $theAttr, 3 ); $result = 0;