X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FLaTeX%2FTikZ%2FFunctor%2FRule.pm;h=bccbb48d739707e5a5f416d4356c98533596416d;hb=e82708f9111395800d13087a846bbec8a76cfcca;hp=df5b553eb5a7256dd7e253f029c75f16d42a230f;hpb=bc1f84f569da48d9d070384eb1bcccac289931e5;p=perl%2Fmodules%2FLaTeX-TikZ.git diff --git a/lib/LaTeX/TikZ/Functor/Rule.pm b/lib/LaTeX/TikZ/Functor/Rule.pm index df5b553..bccbb48 100644 --- a/lib/LaTeX/TikZ/Functor/Rule.pm +++ b/lib/LaTeX/TikZ/Functor/Rule.pm @@ -129,6 +129,8 @@ If C<$replace> is false, then the rule will be appended to the C<@list> ; except If C<$replace> is true, then the rule will replace the first rule in the list that is a subclass or that consumes the role denoted by the target. All the subsequent rules in the list that inherit or consume the target will be removed. +Returns true if and only if an existent rule was replaced. + =cut sub insert { @@ -140,9 +142,6 @@ sub insert { my $overwrite = $args{overwrite}; my $replace = $args{replace}; - my $target = $rule->target; - my $is_role = $rule->is_role; - if ($replace) { my (@remove, $replaced); @@ -166,6 +165,7 @@ sub insert { return 1 if $replaced; } else { # Replace only an existent rule + my $target = $rule->target; for my $i (0 .. $#$list) { my $old_target = $list->[$i]->target;