Skip to content

Commit

Permalink
Fix Bugzilla � Bug 310180 2.5.2: "1" page number is displayed on ALL …
Browse files Browse the repository at this point in the history
…pages in the footer of PDF document
  • Loading branch information
Gang Liu committed May 19, 2010
1 parent aee5681 commit 29cc988
Showing 1 changed file with 25 additions and 8 deletions.
Expand Up @@ -113,19 +113,36 @@ public Object visitText( TextTemplate.TextNode node, Object value )

public Object visitValue( TextTemplate.ValueNode node, Object value )
{
Object result = null;
if ( values != null )
String expression = node.getValue( );
if ( expression != null )
{
String keyExpr = node.getValue( );
if ( keyExpr != null )
expression = expression.trim( );
if ( "pageNumber".equals( expression )
|| "totalPage".equals( expression ) )
{
Object result = ExpressionUtil.evaluate( context,
Expression.newScript( expression ) );
String text = formatValue( node, result );
buffer.append( text );
}
else
{
keyExpr = keyExpr.trim( );
Object result = null;
if ( values != null )
{
String keyExpr = node.getValue( );
if ( keyExpr != null )
{
keyExpr = keyExpr.trim( );
}
result = values.get( keyExpr );
}

String text = formatValue( node, result );
buffer.append( text );
}
result = values.get( keyExpr );
}

String text = formatValue( node, result );
buffer.append( text );
return value;
}

Expand Down

0 comments on commit 29cc988

Please sign in to comment.