Ignore:
Timestamp:
2005-06-14T15:03:04+12:00 (19 years ago)
Author:
mdewsnip
Message:

Important changes to make_text_xml_safe (for generating Excel spreadsheets), and some variable name changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/gti.pl

    r10050 r10091  
    777777{
    778778    my $text = shift(@_);
    779     $text =~ s/\\/\\\\/g;
     779    $text =~ s/\&/\&amp\;/g;
    780780    $text =~ s/</\&lt\;/g;
    781781    $text =~ s/>/\&gt\;/g;
    782     $text =~ s/\&/\&amp\;/g;
    783782    return $text;
    784783}
     
    963962
    964963    # Model the new target file on the source file, with the target file translations
    965     my $source_file_line = 0;
     964    my $source_file_line_number = 0;
    966965    foreach my $line_key (sort sort_by_line (keys(%source_file_line_to_key_mapping))) {
    967966    # Fill in the gaps before this chunk starts
    968     my $source_file_chunk_starting_line = (split(/-/, $line_key))[0];
    969     my $source_file_chunk_finishing_line = (split(/-/, $line_key))[1];
    970     while ($source_file_line < $source_file_chunk_starting_line) {
    971         print TARGET_FILE @$source_file_lines[$source_file_line];
    972         $source_file_line++;
     967    my $source_file_chunk_starting_line_number = (split(/-/, $line_key))[0];
     968    my $source_file_chunk_finishing_line_number = (split(/-/, $line_key))[1];
     969    while ($source_file_line_number < $source_file_chunk_starting_line_number) {
     970        print TARGET_FILE @$source_file_lines[$source_file_line_number];
     971        $source_file_line_number++;
    973972    }
    974     $source_file_line = $source_file_chunk_finishing_line + 1;
     973    $source_file_line_number = $source_file_chunk_finishing_line_number + 1;
    975974
    976975    my $chunk_key = $source_file_line_to_key_mapping{$line_key};
     
    988987
    989988    # Grab the source chunk text
    990     my $source_file_chunk = @$source_file_lines[$source_file_chunk_starting_line];
    991     for (my $l = ($source_file_chunk_starting_line + 1); $l <= $source_file_chunk_finishing_line; $l++) {
     989    my $source_file_chunk = @$source_file_lines[$source_file_chunk_starting_line_number];
     990    for (my $l = ($source_file_chunk_starting_line_number + 1); $l <= $source_file_chunk_finishing_line_number; $l++) {
    992991        $source_file_chunk .= @$source_file_lines[$l];
    993992    }
     
    11101109
    11111110    # Model the new target file on the source file, with the target file translations
    1112     my $source_file_line = 0;
     1111    my $source_file_line_number = 0;
    11131112    foreach my $line_key (sort sort_by_line (keys(%source_file_line_to_key_mapping))) {
    11141113    # Fill in the gaps before this chunk starts
    1115     my $source_file_chunk_starting_line = (split(/-/, $line_key))[0];
    1116     my $source_file_chunk_finishing_line = (split(/-/, $line_key))[1];
    1117     while ($source_file_line < $source_file_chunk_starting_line) {
    1118         print TARGET_FILE @$source_file_lines[$source_file_line];
    1119         $source_file_line++;
     1114    my $source_file_chunk_starting_line_number = (split(/-/, $line_key))[0];
     1115    my $source_file_chunk_finishing_line_number = (split(/-/, $line_key))[1];
     1116    while ($source_file_line_number < $source_file_chunk_starting_line_number) {
     1117        print TARGET_FILE @$source_file_lines[$source_file_line_number];
     1118        $source_file_line_number++;
    11201119    }
    1121     $source_file_line = $source_file_chunk_finishing_line + 1;
     1120    $source_file_line_number = $source_file_chunk_finishing_line_number + 1;
    11221121
    11231122    my $chunk_key = $source_file_line_to_key_mapping{$line_key};
Note: See TracChangeset for help on using the changeset viewer.