]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged changes from Trunk.
authorJeremias Maerki <jeremias@apache.org>
Mon, 19 Jul 2010 09:09:55 +0000 (09:09 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 19 Jul 2010 09:09:55 +0000 (09:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Color@965391 13f79535-47bb-0310-9956-ffa450edef68

1  2 
src/java/org/apache/fop/pdf/PDFName.java

index 744e717d64c411a33d2739a3fe6d60a7780d799b,8214cda7694ef19f8fc76405073295c7c692e50f..2cfe93947a59f6c6e56974afcaeddcaf944d1d97
@@@ -49,10 -49,12 +49,13 @@@ public class PDFName extends PDFObject 
       */
      static String escapeName(String name) {
          StringBuffer sb = new StringBuffer(Math.min(16, name.length() + 4));
-         if (!name.startsWith("/")) {
-             sb.append('/');
+         boolean skipFirst = false;
+         sb.append('/');
+         if (name.startsWith("/")) {
+             skipFirst = true;
++            skipFirst = false;
          }
-         for (int i = 0, c = name.length(); i < c; i++) {
+         for (int i = (skipFirst ? 1 : 0), c = name.length(); i < c; i++) {
              char ch = name.charAt(i);
              if (ch < 33 || ch > 126 || ch == 0x2F) {
                  sb.append('#');