X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FExcel.pm;h=a590b3837e44c80d9e58fcdd45855cc4efc95044;hb=5474d397bbc42ffaea0b51ebb4bb9a4c7afaa881;hp=206e0437c85b576c18461a1f3c0c7873689a9495;hpb=439e45e4d2ae4d410a4d6b27371b34ff0af5baa9;p=kivitendo-erp.git diff --git a/SL/Template/Excel.pm b/SL/Template/Excel.pm index 206e0437c..a590b3837 100644 --- a/SL/Template/Excel.pm +++ b/SL/Template/Excel.pm @@ -1,5 +1,6 @@ package SL::Template::Excel; +use strict; use parent qw(SL::Template::Simple); sub new { @@ -46,11 +47,11 @@ sub parse { my $contents = join("", @lines); my @indices; - $contents =~ s{ - $self->{tag_start} [<]* (\s?) [<>\s]* ([\w\s]+) [<>\s]* $self->{tag_end} - }{ - $self->format_vars(align_right => $1 ne '', varstring => $2, length => length($&), indices => \@indices) - }egx; + $contents =~ s% + ( $self->{tag_start} [<]* (\s?) [<>\s]* ([\w\s]+) [<>\s]* $self->{tag_end} ) + % + $self->format_vars(align_right => $2 ne '', varstring => $3, length => length($1), indices => \@indices) + %egx; if (!defined($contents)) { $main::lxdebug->leave_sub(); @@ -74,10 +75,6 @@ sub format_vars { $varstring =~ s/(\w+)/ $self->_get_loop_variable($1, 0, @indices) /eg; my $old_string=$varstring; my $new_string = sprintf "%*s", ($align_right ? 1 : -1 ) * $length, $varstring; - if (!defined($new_string) || $new_string eq ''){ - $main::lxdebug->message(0, 'varstring' . $varstring . "old" . $old_string); - # return substr $varstring, ($align_right ? (0, $length) : -$length); - } return substr $new_string, ($align_right ? (0, $length) : -$length); }