From d743821ec3b71e00af5dc5541d4e7bf5b003c55e Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sun, 24 Apr 2022 03:42:26 +0000 Subject: xpdf 4.04 git-svn-id: svn://tug.org/texlive/trunk@63119 c570f23f-e606-0410-a88d-b1316a301751 --- .../libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc | 40 +++------------------- 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc') diff --git a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc index 5eec7a9fc6c..0a2100fde9b 100644 --- a/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc +++ b/Build/source/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc @@ -232,6 +232,10 @@ CharCodeToUnicode *CharCodeToUnicode::make8BitToUnicode(Unicode *toUnicode) { return new CharCodeToUnicode(NULL, toUnicode, 256, gTrue, NULL, 0, 0); } +CharCodeToUnicode *CharCodeToUnicode::make16BitToUnicode(Unicode *toUnicode) { + return new CharCodeToUnicode(NULL, toUnicode, 65536, gTrue, NULL, 0, 0); +} + CharCodeToUnicode *CharCodeToUnicode::parseCMap(GString *buf, int nBits) { CharCodeToUnicode *ctu; GStringIndex idx; @@ -470,24 +474,17 @@ GBool CharCodeToUnicode::parseCMap1(int (*getCharFunc)(void *), void *data, void CharCodeToUnicode::addMapping(CharCode code, char *uStr, int n, int offset) { CharCode oldLen, i; -#if 1 //~utf16 Unicode u[maxUnicodeString]; int uLen, j; -#else - Unicode u; - int j; -#endif if (code > 0xffffff) { // This is an arbitrary limit to avoid integer overflow issues. // (I've seen CMaps with mappings for .) return; } -#if 1 //~utf16 if ((uLen = parseUTF16String(uStr, n, u)) == 0) { return; } -#endif if (code >= mapLen) { oldLen = mapLen; mapLen = mapLen ? 2 * mapLen : 256; @@ -499,7 +496,6 @@ void CharCodeToUnicode::addMapping(CharCode code, char *uStr, int n, map[i] = 0; } } -#if 1 //~utf16 if (uLen == 1) { map[code] = u[0] + offset; } else { @@ -517,34 +513,6 @@ void CharCodeToUnicode::addMapping(CharCode code, char *uStr, int n, sMap[sMapLen].len = uLen; ++sMapLen; } -#else //~utf16 - if (n <= 4) { - if (!parseHex(uStr, n, &u)) { - error(errSyntaxWarning, -1, "Illegal entry in ToUnicode CMap"); - return; - } - map[code] = u + offset; - } else { - if (sMapLen >= sMapSize) { - sMapSize = sMapSize + 16; - sMap = (CharCodeToUnicodeString *) - greallocn(sMap, sMapSize, sizeof(CharCodeToUnicodeString)); - } - map[code] = 0; - sMap[sMapLen].c = code; - if ((sMap[sMapLen].len = n / 4) > maxUnicodeString) { - sMap[sMapLen].len = maxUnicodeString; - } - for (j = 0; j < sMap[sMapLen].len; ++j) { - if (!parseHex(uStr + j*4, 4, &sMap[sMapLen].u[j])) { - error(errSyntaxWarning, -1, "Illegal entry in ToUnicode CMap"); - return; - } - } - sMap[sMapLen].u[sMap[sMapLen].len - 1] += offset; - ++sMapLen; - } -#endif //~utf16 } // Convert a UTF-16BE hex string into a sequence of up to -- cgit v1.2.3