diff options
author | Jeremias Maerki <jeremias@apache.org> | 2010-07-19 09:04:01 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2010-07-19 09:04:01 +0000 |
commit | 0622d1a9d57512a5a4e026c2ad335b948e63b32e (patch) | |
tree | d3c6094bb0cb51f3ba11422694f6c40304fed2d2 /src/java/org/apache/fop/pdf | |
parent | 5c356af288f445eab2c43406f26517cacf2a6368 (diff) | |
download | xmlgraphics-fop-0622d1a9d57512a5a4e026c2ad335b948e63b32e.tar.gz xmlgraphics-fop-0622d1a9d57512a5a4e026c2ad335b948e63b32e.zip |
Bugfix of bugfix for escaped PDF names.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@965390 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf')
-rw-r--r-- | src/java/org/apache/fop/pdf/PDFName.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFName.java b/src/java/org/apache/fop/pdf/PDFName.java index 8628a90a7..8214cda76 100644 --- a/src/java/org/apache/fop/pdf/PDFName.java +++ b/src/java/org/apache/fop/pdf/PDFName.java @@ -49,10 +49,12 @@ 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; } - 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('#'); |