diff options
author | tsepez <tsepez@chromium.org> | 2016-03-25 15:18:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-25 15:18:36 -0700 |
commit | b5e8f14e3eefc5da995b332788d3203cee204883 (patch) | |
tree | 34fc80504d2034013b18f30df1b0f6f1a94e2d70 /core/fpdfapi/fpdf_font/fpdf_font.cpp | |
parent | 6d18bd3b8ec82ae3c24a439f5c7925786a0e2d8b (diff) | |
download | pdfium-b5e8f14e3eefc5da995b332788d3203cee204883.tar.xz |
Remove FX_DWORD from core/ and delete definitionchromium/2695chromium/2694chromium/2693chromium/2692
Review URL: https://codereview.chromium.org/1832173003
Diffstat (limited to 'core/fpdfapi/fpdf_font/fpdf_font.cpp')
-rw-r--r-- | core/fpdfapi/fpdf_font/fpdf_font.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp index c0c6f520f4..b0659b4a52 100644 --- a/core/fpdfapi/fpdf_font/fpdf_font.cpp +++ b/core/fpdfapi/fpdf_font/fpdf_font.cpp @@ -90,25 +90,24 @@ short TT2PDF(int m, FXFT_Face face) { return (m * 1000 + upm / 2) / upm; } - -CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode) { +CFX_WideString CPDF_ToUnicodeMap::Lookup(uint32_t charcode) { auto it = m_Map.find(charcode); if (it != m_Map.end()) { - FX_DWORD value = it->second; + uint32_t value = it->second; FX_WCHAR unicode = (FX_WCHAR)(value & 0xffff); if (unicode != 0xffff) { return unicode; } const FX_WCHAR* buf = m_MultiCharBuf.GetBuffer(); - FX_DWORD buf_len = m_MultiCharBuf.GetLength(); + uint32_t buf_len = m_MultiCharBuf.GetLength(); if (!buf || buf_len == 0) { return CFX_WideString(); } - FX_DWORD index = value >> 16; + uint32_t index = value >> 16; if (index >= buf_len) { return CFX_WideString(); } - FX_DWORD len = buf[index]; + uint32_t len = buf[index]; if (index + len < index || index + len >= buf_len) { return CFX_WideString(); } @@ -120,7 +119,7 @@ CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode) { return CFX_WideString(); } -FX_DWORD CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode) { +uint32_t CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode) { for (const auto& pair : m_Map) { if (pair.second == unicode) return pair.first; @@ -129,7 +128,7 @@ FX_DWORD CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode) { } // Static. -FX_DWORD CPDF_ToUnicodeMap::StringToCode(const CFX_ByteStringC& str) { +uint32_t CPDF_ToUnicodeMap::StringToCode(const CFX_ByteStringC& str) { const FX_CHAR* buf = str.GetCStr(); int len = str.GetLength(); if (len == 0) @@ -209,7 +208,7 @@ void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream) { if (word.IsEmpty() || word == "endbfchar") { break; } - FX_DWORD srccode = StringToCode(word); + uint32_t srccode = StringToCode(word); word = parser.GetWord(); CFX_WideString destcode = StringToWideString(word); int len = destcode.GetLength(); @@ -232,15 +231,15 @@ void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream) { break; } high = parser.GetWord(); - FX_DWORD lowcode = StringToCode(low); - FX_DWORD highcode = + uint32_t lowcode = StringToCode(low); + uint32_t highcode = (lowcode & 0xffffff00) | (StringToCode(high) & 0xff); - if (highcode == (FX_DWORD)-1) { + if (highcode == (uint32_t)-1) { break; } CFX_ByteString start = parser.GetWord(); if (start == "[") { - for (FX_DWORD code = lowcode; code <= highcode; code++) { + for (uint32_t code = lowcode; code <= highcode; code++) { CFX_ByteString dest = parser.GetWord(); CFX_WideString destcode = StringToWideString(dest); int len = destcode.GetLength(); @@ -259,14 +258,14 @@ void CPDF_ToUnicodeMap::Load(CPDF_Stream* pStream) { } else { CFX_WideString destcode = StringToWideString(start); int len = destcode.GetLength(); - FX_DWORD value = 0; + uint32_t value = 0; if (len == 1) { value = StringToCode(start); - for (FX_DWORD code = lowcode; code <= highcode; code++) { + for (uint32_t code = lowcode; code <= highcode; code++) { m_Map[code] = value++; } } else { - for (FX_DWORD code = lowcode; code <= highcode; code++) { + for (uint32_t code = lowcode; code <= highcode; code++) { CFX_WideString retcode; if (code == lowcode) { retcode = destcode; |