X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d3897394b6547332743ef7a0c984d391f872373c..03ea97647e3fbdea4323f4f2136bdfa87cb15c1b:/SL/ReportGenerator.pm diff --git a/SL/ReportGenerator.pm b/SL/ReportGenerator.pm index ef20879c6..988d295e6 100644 --- a/SL/ReportGenerator.pm +++ b/SL/ReportGenerator.pm @@ -4,7 +4,6 @@ use IO::Wrap; use List::Util qw(max); use Text::CSV_XS; use Text::Iconv; -use PDF::Table; use SL::Form; @@ -61,34 +60,9 @@ sub new { $self->set_options(@_) if (@_); - $self->_init_escaped_strings_map(); - return $self; } -sub _init_escaped_strings_map { - my $self = shift; - - $self->{escaped_strings_map} = { - 'ä' => 'ä', - 'ö' => 'ö', - 'ü' => 'ü', - 'Ä' => 'Ä', - 'Ö' => 'Ö', - 'Ü' => 'Ü', - 'ß' => 'ß', - '>' => '>', - '<' => '<', - '"' => '"', - }; - - my $iconv = $main::locale->{iconv_iso8859}; - - if ($iconv) { - map { $self->{escaped_strings_map}->{$_} = $iconv->convert($self->{escaped_strings_map}->{$_}) } keys %{ $self->{escaped_strings_map} }; - } -} - sub set_columns { my $self = shift; my %columns = @_; @@ -278,7 +252,7 @@ sub html_format { my $self = shift; my $value = shift; - $value = $self->{form}->quote_html($value); + $value = $main::locale->quote_special_chars('HTML', $value); $value =~ s/\r//g; $value =~ s/\n/
/g; @@ -768,14 +742,12 @@ sub generate_pdf_content { } sub unescape_string { - my $self = shift; - my $text = shift; - - foreach my $key (keys %{ $self->{escaped_strings_map} }) { - $text =~ s/\Q$key\E/$self->{escaped_strings_map}->{$key}/g; - } + my $self = shift; + my $text = shift; + my $iconv = $main::locale->{iconv}; - $text =~ s/\Q&\E/&/g; + $text = $main::locale->unquote_special_chars('HTML', $text); + $text = $main::locale->{iconv}->convert($text) if ($main::locale->{iconv}); return $text; }