diff options
author | L Peter Deutsch <lpd@ghostscript.com> | 2002-03-19 17:35:11 +0000 |
---|---|---|
committer | L Peter Deutsch <lpd@ghostscript.com> | 2002-03-19 17:35:11 +0000 |
commit | c278339fb640b87131093aa52ef49637993cfa43 (patch) | |
tree | 2ed2159c7560e06ca1cedd39424634b65b45e4b0 /gs/src/gdevpdfu.c | |
parent | 66f1e34f50e16e27a3f8019df00a777a207a8b0c (diff) |
Removes a last vestige of PDF 1.1 support (which was otherwise removed some
time ago) from pdfwrite.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@2330 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpdfu.c')
-rw-r--r-- | gs/src/gdevpdfu.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/gs/src/gdevpdfu.c b/gs/src/gdevpdfu.c index d4909a8cf..abffea10c 100644 --- a/gs/src/gdevpdfu.c +++ b/gs/src/gdevpdfu.c @@ -705,38 +705,12 @@ pdf_put_matrix(gx_device_pdf * pdev, const char *before, } /* - * Write a name, with escapes for unusual characters. In PDF 1.1, we have - * no choice but to replace these characters with '?'; in PDF 1.2, we can - * use an escape sequence for anything except a null <00>. + * Write a name, with escapes for unusual characters. Since we only support + * PDF 1.2 and above, we can use an escape sequence for anything except a + * null <00>, and the machinery for selecting the put_name_chars procedure + * depending on CompatibilityLevel is no longer needed. */ private int -pdf_put_name_chars_1_1(stream *s, const byte *nstr, uint size) -{ - uint i; - - for (i = 0; i < size; ++i) { - uint c = nstr[i]; - - switch (c) { - default: - if (c >= 0x21 && c <= 0x7e) { - stream_putc(s, c); - break; - } - /* falls through */ - case '%': - case '(': case ')': - case '<': case '>': - case '[': case ']': - case '{': case '}': - case '/': - case 0: - stream_putc(s, '?'); - } - } - return 0; -} -private int pdf_put_name_chars_1_2(stream *s, const byte *nstr, uint size) { uint i; @@ -771,8 +745,7 @@ pdf_put_name_chars_1_2(stream *s, const byte *nstr, uint size) pdf_put_name_chars_proc_t pdf_put_name_chars_proc(const gx_device_pdf *pdev) { - return (pdev->CompatibilityLevel >= 1.2 ? pdf_put_name_chars_1_2 : - pdf_put_name_chars_1_1); + return pdf_put_name_chars_1_2; } void pdf_put_name_chars(const gx_device_pdf *pdev, const byte *nstr, uint size) |