[Po4a-commits] "po4a/lib/Locale/Po4a Xml.pm, 1.86, 1.87 TransTractor.pm, 1.100, 1.101"
Nicolas FRANCOIS
nekral-guest at alioth.debian.org
Fri Jan 30 22:04:57 UTC 2009
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory alioth:/tmp/cvs-serv16919/lib/Locale/Po4a
Modified Files:
Xml.pm TransTractor.pm
Log Message:
* lib/Locale/Po4a/TransTractor.pm, lib/Locale/Po4a/Xml.pm: Allow
arrays in input of unshiftline (instead of only 2 elements)
Index: Xml.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/Xml.pm,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- Xml.pm 30 Jan 2009 21:52:39 -0000 1.86
+++ Xml.pm 30 Jan 2009 22:04:55 -0000 1.87
@@ -98,10 +98,7 @@
push @textentries, ($after, $ref);
$line = $before.(shift @textentries);
$ref .= " ".(shift @textentries);
- while (@textentries) {
- my ($r, $l) = (pop @textentries, pop @textentries);
- $self->unshiftline($l,$r);
- }
+ $self->unshiftline(@textentries);
}
}
@@ -1713,11 +1710,7 @@
}
}
if (!$remove) {
- my $i = $#text;
- while ($i > 0) {
- $self->unshiftline ($text[$i-1],$text[$i]);
- $i -= 2;
- }
+ $self->unshiftline (@text);
}
#If we get to the end of the file, we return the whole paragraph
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- TransTractor.pm 20 Jul 2008 16:17:08 -0000 1.100
+++ TransTractor.pm 30 Jan 2009 22:04:55 -0000 1.101
@@ -725,7 +725,10 @@
shift @{$_[0]->{TT}{doc_in}});
return ($line,$ref);
}
-sub unshiftline { unshift @{$_[0]->{TT}{doc_in}},($_[1],$_[2]); }
+sub unshiftline {
+ my $self = shift;
+ unshift @{$self->{TT}{doc_in}}, at _;
+}
sub pushline { push @{$_[0]->{TT}{doc_out}}, $_[1] if defined $_[1]; }
sub popline { return pop @{$_[0]->{TT}{doc_out}}; }
More information about the Po4a-commits
mailing list