? 01-xpdf-3.00pl1.patch ? 02-xpdf-3.00pl2.patch ? 03-xpdf-3.00pl3.patch ? 10-xpdf-3.01-docs.patch ? 11-xpdf-3.01-fixedpoint.patch ? 12-xpdf-3.01-no-no-decryption.patch ? 13-xpdf-3.01-goo-allocn.patch ? 14-xpdf-3.01-copyright-etc-updates.patch ? 15-xpdf-3.01-new-freetype.patch ? 16-xpdf-3.01-plugins.patch ? 17-xpdf-3.01-goo-improvements.patch ? 18-xpdf-3.01-configure-improvements.patch ? 19-xpdf-3.01-encrypt-metadata-flag.patch ? 20-xpdf-3.01-win32-no-unlink.patch ? 21-xpdf-3.01-win32-files-and-paths.patch ? 24-xpdf-3.01-splash-modified-region.patch ? 25-xpdf-3.01-cropbox-as-page-size.patch ? patches Index: poppler/CharCodeToUnicode.cc =================================================================== RCS file: /cvs/poppler/poppler/poppler/CharCodeToUnicode.cc,v retrieving revision 1.2 diff -u -r1.2 CharCodeToUnicode.cc --- poppler/CharCodeToUnicode.cc 27 Aug 2005 08:43:43 -0000 1.2 +++ poppler/CharCodeToUnicode.cc 15 Sep 2005 14:26:28 -0000 @@ -251,7 +251,7 @@ error(-1, "Illegal entry in bfchar block in ToUnicode CMap"); continue; } - addMapping(code1, tok2 + 1, n2 - 1, 0); + addMapping(code1, tok2 + 1, n2 - 2, 0); } pst->getToken(tok1, sizeof(tok1), &n1); } else if (!strcmp(tok2, "beginbfrange")) { @@ -433,23 +433,30 @@ } void CharCodeToUnicode::setMapping(CharCode c, Unicode *u, int len) { - int i; + int i, j; if (len == 1) { map[c] = u[0]; } else { - map[c] = 0; - if (sMapLen == sMapSize) { - sMapSize += 8; - sMap = (CharCodeToUnicodeString *) - greallocn(sMap, sMapSize, sizeof(CharCodeToUnicodeString)); + for (i = 0; i < sMapLen; ++i) { + if (sMap[i].c == c) { + break; + } } - sMap[sMapLen].c = c; - sMap[sMapLen].len = len; - for (i = 0; i < len && i < maxUnicodeString; ++i) { - sMap[sMapLen].u[i] = u[i]; + if (i == sMapLen) { + if (sMapLen == sMapSize) { + sMapSize += 8; + sMap = (CharCodeToUnicodeString *) + greallocn(sMap, sMapSize, sizeof(CharCodeToUnicodeString)); + } + ++sMapLen; + } + map[c] = 0; + sMap[i].c = c; + sMap[i].len = len; + for (j = 0; j < len && j < maxUnicodeString; ++j) { + sMap[i].u[j] = u[j]; } - ++sMapLen; } } Index: poppler/CharCodeToUnicode.h =================================================================== RCS file: /cvs/poppler/poppler/poppler/CharCodeToUnicode.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 CharCodeToUnicode.h --- poppler/CharCodeToUnicode.h 3 Mar 2005 19:46:00 -0000 1.1.1.1 +++ poppler/CharCodeToUnicode.h 15 Sep 2005 14:26:28 -0000 @@ -66,6 +66,10 @@ // Map a CharCode to Unicode. int mapToUnicode(CharCode c, Unicode *u, int size); + // Return the mapping's length, i.e., one more than the max char + // code supported by the mapping. + CharCode getLength() { return mapLen; } + private: void parseCMap1(int (*getCharFunc)(void *), void *data, int nBits);