X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=development%2Fautotests%2FlyxStatus.pm;h=ef18c897bb2854ada818ed5eedcd5075d71f1f5b;hb=c4ae71ceb2cfbc3e8fb52cfbc8396a6309af5dbc;hp=8a031840e9d070299638c8f7cb13397f39ebd36f;hpb=b178770ce3dc9e115f69df05fbbb5f83556ffe13;p=lyx.git diff --git a/development/autotests/lyxStatus.pm b/development/autotests/lyxStatus.pm index 8a031840e9..ef18c897bb 100644 --- a/development/autotests/lyxStatus.pm +++ b/development/autotests/lyxStatus.pm @@ -14,7 +14,7 @@ BEGIN { } # Prototypes -sub initLyxStack($$); +sub initLyxStack($$$); sub diestack($); sub closeLyxStack(); sub setMatching($); @@ -36,6 +36,7 @@ sub checkLyxLine($); my @stack = (); # list of HASH-Arrays my $rFont = {}; my $useNonTexFont = "true"; +my $inputEncoding = undef; # The elements are: # type (layout, inset, header, preamble, ...) @@ -49,7 +50,7 @@ my $useNonTexFont = "true"; # but first set the modified value into $result->[$fileidx] # numerical value will be replaced with appropriate matching group value -sub initLyxStack($$) +sub initLyxStack($$$) { $rFont = $_[0]; if ($_[1] eq "systemF") { @@ -57,6 +58,7 @@ sub initLyxStack($$) } else { $useNonTexFont = "false"; + $inputEncoding = $_[2]; } $stack[0] = { type => "Starting"}; } @@ -196,16 +198,31 @@ sub checkForHeader($) "result" => ["\\master ", ""]); if (keys %{$rFont}) { for my $ff ( keys %{$rFont}) { - my $elem = newMatch("search" => '^\\\\font_' . $ff . '\s+', + # fontentry of type '\font_roman default' + my $elem = newMatch("search" => '^\\\\font_' . $ff . '\s+[^"]*\s*$', "filetype" => "replace_only", "result" => ["\\font_$ff ", $rFont->{$ff}]); - push(@rElems, $elem); + # fontentry of type '\font_roman "default"' + my $elem1 = newMatch("search" => '^\\\\font_' . $ff . '\s+"[^"]*"\s*$', + "filetype" => "replace_only", + "result" => ["\\font_$ff \"", $rFont->{$ff}, '"']); + # fontentry of type '\font_roman "default" "default"' + my $elem2 = newMatch("search" => '^\\\\font_' . $ff . '\s+"(.*)"\s+"(.*)"\s*$', + "filetype" => "replace_only", + "result" => ["\\font_$ff ", '"', "1", '" "', $rFont->{$ff}, '"']); + push(@rElems, $elem, $elem1, $elem2); } } my $elemntf = newMatch("search" => '^\\\\use_non_tex_fonts\s+(false|true)', "filetype" => "replace_only", "result" => ["\\use_non_tex_fonts $useNonTexFont"]); push(@rElems, $elemntf); + if (defined($inputEncoding)) { + my $inputenc = newMatch("search" => '^\\\\inputencoding\s+(' . $inputEncoding->{search} . ')', + "filetype" => "replace_only", + "result" => ["\\inputencoding " . $inputEncoding->{out}]); + push(@rElems, $inputenc); + } setMatching(\@rElems); return(1); }