[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Tue May 13 10:05:01 2003


User:      heins
Date:      2003-05-13 14:04:50 GMT
Modified:  lib/Vend Interpolate.pm
Log:
* Make mv_return_fields available to iterate_array_list.

* Change processing of [PREFIX-line] to use that value instead of
  rebuilding from scratch.

Revision  Changes    Path
2.166     +6 -6      interchange/lib/Vend/Interpolate.pm


rev 2.166, prev_rev 2.165
Index: Interpolate.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.165
retrieving revision 2.166
diff -u -r2.165 -r2.166
--- Interpolate.pm	12 May 2003 14:40:23 -0000	2.165
+++ Interpolate.pm	13 May 2003 14:04:50 -0000	2.166
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 # 
-# $Id: Interpolate.pm,v 2.165 2003/05/12 14:40:23 mheins Exp $
+# $Id: Interpolate.pm,v 2.166 2003/05/13 14:04:50 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -27,7 +27,7 @@
 require Exporter;
 @ISA = qw(Exporter);
 
-$VERSION = substr(q$Revision: 2.165 $, 10);
+$VERSION = substr(q$Revision: 2.166 $, 10);
 
 @EXPORT = qw (
 
@@ -3836,6 +3836,7 @@
 				$fh->{$_} = $idx++;
 			}
 		}
+		$opt->{mv_return_fields} = $fa;
 #::logDebug("Missing mv_field_hash and/or mv_field_names in Vend::Interpolate::labeled_list") unless ref $fh eq 'HASH';
 		$r = iterate_array_list($i, $end, $count, $text, $ary, $opt_select, $fh, $opt);
 	}
@@ -4196,10 +4197,9 @@
 #::logDebug("iterating array $i to $end. count=$count opt_select=$opt_select ary=" . uneval($ary));
 	if($text =~ m/^$B$QR{_line}\s*$/is) {
 		my $i = $1 || 0;
-		my $count = scalar values %$fh;
-		$count--;
-		my (@ary) = sort { $fh->{$a} <=> $fh->{$b} } keys %$fh;
-		$r .= join "\t", @ary[$i .. $count];
+		my $fa = $opt->{mv_return_fields};
+		my $end = 
+		$r .= join "\t", @$fa[$i .. $#$fa];
 		$r .= "\n";
 	}
 	while($text =~ s#$B$QR{_sub}$E$QR{'/_sub'}##i) {