Update of /cvsroot/webmacro/webmacro/src/org/webmacro/directive
In directory sc8-pr-cvs1:/tmp/cvs-serv21898/src/org/webmacro/directive
Modified Files:
CountDirective.java
Log Message:
Made #count work out whether an implicit step -1 can be used.
Index: CountDirective.java
===================================================================
RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/directive/CountDirective.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CountDirective.java 12 Jun 2003 00:47:44 -0000 1.5
--- CountDirective.java 29 Jul 2003 17:33:46 -0000 1.6
***************
*** 76,80 ****
private Object _objStep;
! private int _start, _end, _step = 1;
public Object build (DirectiveBuilder builder, BuildContext bc) throws BuildException
--- 76,80 ----
private Object _objStep;
! private int _start, _end, _step = Integer.MAX_VALUE;
public Object build (DirectiveBuilder builder, BuildContext bc) throws BuildException
***************
*** 181,184 ****
--- 181,190 ----
return;
}
+ }
+
+ // Check if no step explicitly assigned, if so auto-detect it
+ if (step == Integer.MAX_VALUE )
+ {
+ step = (start > end) ? -1 : +1;
}
|