From 0b7d4ff9ae2dacb468b30db59d048301fcd8e3ff Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 21 Jan 2014 16:50:21 +0100 Subject: [PATCH] =?utf8?q?Refactoring:=20SL::Template:=20Parameter=C3=BCbe?= =?utf8?q?rgabe=20als=20Hash,=20nicht=20positionsabh=C3=A4ngig=20(Teil=202?= =?utf8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Template/LaTeX.pm | 2 +- SL/Template/Simple.pm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/Template/LaTeX.pm b/SL/Template/LaTeX.pm index 23e2ed0ae..6eb331d60 100644 --- a/SL/Template/LaTeX.pm +++ b/SL/Template/LaTeX.pm @@ -589,7 +589,7 @@ sub parse_and_create_pdf { my $error; eval { - my $template = SL::Template::LaTeX->new($template_file_name, $local_form, \%::myconfig, $::lx_office_conf{paths}->{userspath}); + my $template = SL::Template::LaTeX->new(file_name => $template_file_name, form => $local_form); my $result = $template->parse($tex_fh) && $template->convert_to_pdf; die $template->{error} unless $result; diff --git a/SL/Template/Simple.pm b/SL/Template/Simple.pm index a4b98ca71..c525dabe4 100644 --- a/SL/Template/Simple.pm +++ b/SL/Template/Simple.pm @@ -32,6 +32,9 @@ sub new { sub _init { my ($self, %params) = @_; + $params{myconfig} ||= \%::myconfig; + $params{userspath} ||= $::lx_office_conf{paths}->{userspath}; + $self->{$_} = $params{$_} for keys %params; $self->{variable_content_types} ||= {}; -- 2.20.1