jeremias    2003/03/15 08:56:03

  Modified:    src/java/org/apache/fop/pdf PDFStream.java
  Log:
  Improve Filter argument construction
  
  Revision  Changes    Path
  1.2       +14 -10    xml-fop/src/java/org/apache/fop/pdf/PDFStream.java
  
  Index: PDFStream.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/PDFStream.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PDFStream.java    11 Mar 2003 13:05:09 -0000      1.1
  +++ PDFStream.java    15 Mar 2003 16:56:03 -0000      1.2
  @@ -339,20 +339,24 @@
       }
   
       private String buildFilterEntries(List names) {
  +        boolean needFilterEntry = false;
           StringBuffer sb = new StringBuffer();
  -        sb.append("/Filter ");
  -        if (names.size() > 1) {
  -            sb.append("[ ");
  +        sb.append("/Filter [ ");
  +        for (int i = 0; i < names.size(); i++) {
  +            final String name = (String)names.get(i);
  +            if (name.length() > 0) {
  +                needFilterEntry = true;
  +                sb.append(name);
  +                sb.append(" ");
  +            }
           }
  -        for (int count = 0; count < names.size(); count++) {
  -            sb.append((String)names.get(count));
  -            sb.append(" ");
  -        }
  -        if (names.size() > 1) {
  +        if (needFilterEntry) {
               sb.append("]");
  +            sb.append("\n");
  +            return sb.toString();
  +        } else {
  +            return "";
           }
  -        sb.append("\n");
  -        return sb.toString();
       }
   
       private String buildDecodeParms(List parms) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to