[interchange-cvs] interchange - racke modified dist/lib/UI/usertag/row_edit
interchange-core@interchange.redhat.com
interchange-core@interchange.redhat.com
Sun Dec 2 11:29:00 2001
User: racke
Date: 2001-12-02 16:28:28 GMT
Modified: dist/lib/UI/usertag Tag: LINUXIA row_edit
Log:
preserve initial order of given columns
Revision Changes Path
No revision
No revision
1.3.4.1 +4 -2 interchange/dist/lib/UI/usertag/Attic/row_edit
rev 1.3.4.1, prev_rev 1.3
Index: row_edit
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/usertag/Attic/row_edit,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -r1.3 -r1.3.4.1
--- row_edit 2000/08/05 13:28:14 1.3
+++ row_edit 2001/12/02 16:28:28 1.3.4.1
@@ -28,11 +28,13 @@
my @cols;
if($columns) {
@cols = split /[\s,\0]+/, $columns;
- my %col;
+ my (%col, $i);
for(@cols) {
- $col{$_} = 1;
+ $col{$_} = ++$i;
}
@cols = grep defined $col{$_}, $db->columns();
+ # preserve initial order
+ @cols = sort {$col{$a} <=> $col{$b}} @cols;
}
else {
@cols = $db->columns();