summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
commitd7e5cc754a937605d1f73db5e7967c58ddd80742 (patch)
treeed28e012c4d6a46b7f29f15a0c060474c27d4286 /core/src/fpdfapi/fpdf_font
parentbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff)
downloadpdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/font_int.h16
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp64
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp14
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp52
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp2
5 files changed, 75 insertions, 73 deletions
diff --git a/core/src/fpdfapi/fpdf_font/font_int.h b/core/src/fpdfapi/fpdf_font/font_int.h
index 1e52607d98..6f32f4fa98 100644
--- a/core/src/fpdfapi/fpdf_font/font_int.h
+++ b/core/src/fpdfapi/fpdf_font/font_int.h
@@ -12,7 +12,7 @@ class CPDF_CMapManager
public:
CPDF_CMapManager();
~CPDF_CMapManager();
- FX_LPVOID GetPackage(FX_BOOL bPrompt);
+ void* GetPackage(FX_BOOL bPrompt);
CPDF_CMap* GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPrompt);
CPDF_CID2UnicodeMap* GetCID2UnicodeMap(int charset, FX_BOOL bPrompt);
void ReloadAll();
@@ -44,7 +44,7 @@ public:
} m_EmbeddedToUnicodes[NUMBER_OF_CIDSETS];
private:
CFX_MapPtrToPtr m_pStockMap;
- FX_LPBYTE m_pContrastRamps;
+ uint8_t* m_pContrastRamps;
};
struct _CMap_CodeRange {
int m_CharSize;
@@ -81,7 +81,7 @@ class CPDF_CMap
public:
CPDF_CMap();
FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* name, FX_BOOL bPromptCJK);
- FX_BOOL LoadEmbedded(FX_LPCBYTE pData, FX_DWORD dwSize);
+ FX_BOOL LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize);
void Release();
FX_BOOL IsLoaded() const
{
@@ -98,9 +98,9 @@ public:
FX_WORD CIDFromCharCode(FX_DWORD charcode) const;
FX_DWORD CharCodeFromCID(FX_WORD CID) const;
int GetCharSize(FX_DWORD charcode) const;
- FX_DWORD GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) const;
- int CountChar(FX_LPCSTR pString, int size) const;
- int AppendChar(FX_LPSTR str, FX_DWORD charcode) const;
+ FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const;
+ int CountChar(const FX_CHAR* pString, int size) const;
+ int AppendChar(FX_CHAR* str, FX_DWORD charcode) const;
typedef enum {OneByte, TwoBytes, MixedTwoBytes, MixedFourBytes} CodingScheme;
protected:
~CPDF_CMap();
@@ -115,7 +115,7 @@ protected:
int m_nCodeRanges;
uint8_t* m_pLeadingBytes;
FX_WORD* m_pMapping;
- FX_LPBYTE m_pAddMapping;
+ uint8_t* m_pAddMapping;
FX_BOOL m_bLoaded;
const FXCMAP_CMap* m_pEmbedMap;
CPDF_CMap* m_pUseMap;
@@ -123,7 +123,7 @@ protected:
class CPDF_PredefinedCMap
{
public:
- FX_LPCSTR m_pName;
+ const FX_CHAR* m_pName;
int m_Charset;
int m_Coding;
CPDF_CMap::CodingScheme m_CodingScheme;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 0058e140d4..c6922d11f8 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -205,7 +205,7 @@ CFX_WideString CPDF_Font::DecodeString(const CFX_ByteString& str) const
CFX_WideString result;
int src_len = str.GetLength();
result.Reserve(src_len);
- FX_LPCSTR src_buf = str;
+ const FX_CHAR* src_buf = str;
int src_pos = 0;
while (src_pos < src_len) {
FX_DWORD charcode = GetNextChar(src_buf, src_len, src_pos);
@@ -222,8 +222,8 @@ CFX_ByteString CPDF_Font::EncodeString(const CFX_WideString& str) const
{
CFX_ByteString result;
int src_len = str.GetLength();
- FX_LPSTR dest_buf = result.GetBuffer(src_len * 2);
- FX_LPCWSTR src_buf = str.c_str();
+ FX_CHAR* dest_buf = result.GetBuffer(src_len * 2);
+ const FX_WCHAR* src_buf = str.c_str();
int dest_pos = 0;
for (int src_pos = 0; src_pos < src_len; src_pos ++) {
FX_DWORD charcode = CharCodeFromUnicode(src_buf[src_pos]);
@@ -289,7 +289,7 @@ void CPDF_Font::LoadFontDescriptor(CPDF_Dictionary* pFontDesc)
if (m_pFontFile == NULL) {
return;
}
- FX_LPCBYTE pFontData = m_pFontFile->GetData();
+ const uint8_t* pFontData = m_pFontFile->GetData();
FX_DWORD dwFontSize = m_pFontFile->GetSize();
m_Font.LoadEmbedded(pFontData, dwFontSize);
if (m_Font.m_Face == NULL) {
@@ -369,7 +369,7 @@ void CPDF_Font::LoadUnicodeMap()
m_pToUnicodeMap = new CPDF_ToUnicodeMap;
m_pToUnicodeMap->Load(pStream);
}
-int CPDF_Font::GetStringWidth(FX_LPCSTR pString, int size)
+int CPDF_Font::GetStringWidth(const FX_CHAR* pString, int size)
{
int offset = 0;
int width = 0;
@@ -431,7 +431,7 @@ CPDF_Font* CPDF_Font::CreateFontF(CPDF_Document* pDoc, CPDF_Dictionary* pFontDic
int i;
int count = sizeof(ChineseFontNames) / sizeof(ChineseFontNames[0]);
for (i = 0; i < count; ++i) {
- if (tag == CFX_ByteString((FX_LPCSTR)ChineseFontNames[i])) {
+ if (tag == CFX_ByteString((const FX_CHAR*)ChineseFontNames[i])) {
break;
}
}
@@ -500,7 +500,7 @@ CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode)
if (unicode != 0xffff) {
return unicode;
}
- FX_LPCWSTR buf = m_MultiCharBuf.GetBuffer();
+ const FX_WCHAR* buf = m_MultiCharBuf.GetBuffer();
FX_DWORD buf_len = m_MultiCharBuf.GetLength();
if (buf == NULL || buf_len == 0) {
return CFX_WideString();
@@ -534,7 +534,7 @@ FX_DWORD CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode)
}
static FX_DWORD _StringToCode(FX_BSTR str)
{
- FX_LPCSTR buf = str.GetCStr();
+ const FX_CHAR* buf = str.GetCStr();
int len = str.GetLength();
if (len == 0) {
return 0;
@@ -586,7 +586,7 @@ static CFX_WideString _StringDataAdd(CFX_WideString str)
}
static CFX_WideString _StringToWideString(FX_BSTR str)
{
- FX_LPCSTR buf = str.GetCStr();
+ const FX_CHAR* buf = str.GetCStr();
int len = str.GetLength();
if (len == 0) {
return CFX_WideString();
@@ -816,7 +816,7 @@ FX_BOOL CPDF_Font::IsStandardFont() const
}
return TRUE;
}
-extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode);
+extern const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode);
CPDF_SimpleFont::CPDF_SimpleFont(int fonttype) : CPDF_Font(fonttype)
{
FXSYS_memset8(m_CharBBox, 0xff, sizeof m_CharBBox);
@@ -907,13 +907,13 @@ void CPDF_SimpleFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
rect.bottom = m_CharBBox[charcode].Bottom;
rect.top = m_CharBBox[charcode].Top;
}
-FX_LPCSTR GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode)
+const FX_CHAR* GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode)
{
ASSERT(charcode >= 0 && charcode < 256);
if (charcode < 0 || charcode >= 256) {
return NULL;
}
- FX_LPCSTR name = NULL;
+ const FX_CHAR* name = NULL;
if (pCharNames) {
name = pCharNames[charcode];
}
@@ -1081,8 +1081,8 @@ int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode)
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
struct _GlyphNameMap {
- FX_LPCSTR m_pStrAdobe;
- FX_LPCSTR m_pStrUnicode;
+ const FX_CHAR* m_pStrAdobe;
+ const FX_CHAR* m_pStrUnicode;
};
static const _GlyphNameMap g_GlyphNameSubsts[] = {
{"ff", "uniFB00"},
@@ -1094,10 +1094,10 @@ static const _GlyphNameMap g_GlyphNameSubsts[] = {
extern "C" {
static int compareString(const void* key, const void* element)
{
- return FXSYS_stricmp((FX_LPCSTR)key, ((_GlyphNameMap*)element)->m_pStrAdobe);
+ return FXSYS_stricmp((const FX_CHAR*)key, ((_GlyphNameMap*)element)->m_pStrAdobe);
}
}
-static FX_LPCSTR _GlyphNameRemap(FX_LPCSTR pStrAdobe)
+static const FX_CHAR* _GlyphNameRemap(const FX_CHAR* pStrAdobe)
{
_GlyphNameMap* found = (_GlyphNameMap*)FXSYS_bsearch(pStrAdobe, g_GlyphNameSubsts,
sizeof g_GlyphNameSubsts / sizeof(_GlyphNameMap), sizeof(_GlyphNameMap),
@@ -1164,7 +1164,7 @@ void CPDF_Type1Font::LoadGlyphMap()
m_BaseEncoding = PDFFONT_ENCODING_STANDARD;
}
for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
if (name == NULL) {
continue;
}
@@ -1207,7 +1207,7 @@ void CPDF_Type1Font::LoadGlyphMap()
if (bCoreText) {
if (m_Flags & PDFFONT_SYMBOLIC) {
for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
if (name) {
m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
@@ -1244,12 +1244,12 @@ void CPDF_Type1Font::LoadGlyphMap()
bUnicode = TRUE;
}
for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
if (name == NULL) {
continue;
}
m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
- FX_LPCSTR pStrUnicode = _GlyphNameRemap(name);
+ const FX_CHAR* pStrUnicode = _GlyphNameRemap(name);
if (pStrUnicode && 0 == FXFT_Get_Name_Index(m_Font.m_Face, (char*)name)) {
name = pStrUnicode;
}
@@ -1289,7 +1289,7 @@ void CPDF_Type1Font::LoadGlyphMap()
#endif
if (m_Flags & PDFFONT_SYMBOLIC) {
for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
if (name) {
m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
@@ -1322,7 +1322,7 @@ void CPDF_Type1Font::LoadGlyphMap()
bUnicode = TRUE;
}
for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
if (name == NULL) {
continue;
}
@@ -1475,7 +1475,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
}
FX_BOOL bToUnicode = m_pFontDict->KeyExist(FX_BSTRC("ToUnicode"));
for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
if (name == NULL) {
m_GlyphIndex[charcode] = m_pFontFile ? FXFT_Get_Char_Index(m_Font.m_Face, charcode) : -1;
continue;
@@ -1540,7 +1540,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
if (bGotOne) {
if (baseEncoding != PDFFONT_ENCODING_BUILTIN) {
for (int charcode = 0; charcode < 256; charcode ++) {
- FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
if (name == NULL) {
continue;
}
@@ -1572,7 +1572,7 @@ void CPDF_TrueTypeFont::LoadGlyphMap()
const FX_WORD* pUnicodes = PDF_UnicodesForPredefinedCharSet(baseEncoding);
for (int charcode = 0; charcode < 256; charcode ++) {
if (m_pFontFile == NULL) {
- FX_LPCSTR name = GetAdobeCharName(0, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(0, m_pCharNames, charcode);
if (name != NULL) {
m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
} else if (pUnicodes) {
@@ -1603,14 +1603,16 @@ CPDF_Type3Font::~CPDF_Type3Font()
{
FX_POSITION pos = m_CacheMap.GetStartPosition();
while (pos) {
- FX_LPVOID key, value;
+ void* key;
+ void* value;
m_CacheMap.GetNextAssoc(pos, key, value);
delete (CPDF_Type3Char*)value;
}
m_CacheMap.RemoveAll();
pos = m_DeletedMap.GetStartPosition();
while (pos) {
- FX_LPVOID key, value;
+ void* key;
+ void* value;
m_DeletedMap.GetNextAssoc(pos, key, value);
delete (CPDF_Type3Char*)key;
}
@@ -1671,15 +1673,15 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
return NULL;
}
CPDF_Type3Char* pChar = NULL;
- if (m_CacheMap.Lookup((FX_LPVOID)(uintptr_t)charcode, (FX_LPVOID&)pChar)) {
+ if (m_CacheMap.Lookup((void*)(uintptr_t)charcode, (void*&)pChar)) {
if (pChar->m_bPageRequired && m_pPageResources) {
delete pChar;
- m_CacheMap.RemoveKey((FX_LPVOID)(uintptr_t)charcode);
+ m_CacheMap.RemoveKey((void*)(uintptr_t)charcode);
return LoadChar(charcode, level + 1);
}
return pChar;
}
- FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
+ const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
if (name == NULL) {
return NULL;
}
@@ -1703,7 +1705,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
rcBBox.right = FXSYS_round(char_rect.right * 1000);
rcBBox.top = FXSYS_round(char_rect.top * 1000);
rcBBox.bottom = FXSYS_round(char_rect.bottom * 1000);
- m_CacheMap.SetAt((FX_LPVOID)(uintptr_t)charcode, pChar);
+ m_CacheMap.SetAt((void*)(uintptr_t)charcode, pChar);
if (pChar->m_pForm->CountObjects() == 0) {
delete pChar->m_pForm;
pChar->m_pForm = NULL;
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
index 8e8fccd8a3..8d2f922fb1 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp
@@ -264,7 +264,7 @@ const FX_WORD ZapfEncoding[256] = {
0x0000, 0x27B1, 0x27B2, 0x27B3, 0x27B4, 0x27B5, 0x27B6, 0x27B7,
0x27B8, 0x27B9, 0x27BA, 0x27BB, 0x27BC, 0x27BD, 0x27BE, 0x0000,
};
-const FX_LPCSTR StandardEncodingNames[224] = {
+const FX_CHAR* const StandardEncodingNames[224] = {
"space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright",
"parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
"zero", "one", "two", "three", "four", "five", "six", "seven",
@@ -294,7 +294,7 @@ const FX_LPCSTR StandardEncodingNames[224] = {
NULL, "ae", NULL, NULL, NULL, "dotlessi", NULL, NULL,
"lslash", "oslash", "oe", "germandbls", NULL, NULL, NULL, NULL,
};
-const FX_LPCSTR AdobeWinAnsiEncodingNames[224] = {
+const FX_CHAR* const AdobeWinAnsiEncodingNames[224] = {
"space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
"parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
"zero", "one", "two", "three", "four", "five", "six", "seven",
@@ -324,7 +324,7 @@ const FX_LPCSTR AdobeWinAnsiEncodingNames[224] = {
"eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide",
"oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis",
};
-const FX_LPCSTR MacRomanEncodingNames[224] = {
+const FX_CHAR* const MacRomanEncodingNames[224] = {
"space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
"parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
"zero", "one", "two", "three", "four", "five", "six", "seven",
@@ -354,7 +354,7 @@ const FX_LPCSTR MacRomanEncodingNames[224] = {
"apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde",
"macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron",
};
-const FX_LPCSTR MacExpertEncodingNames[224] = {
+const FX_CHAR* const MacExpertEncodingNames[224] = {
"space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall",
"parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction",
"zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle",
@@ -384,7 +384,7 @@ const FX_LPCSTR MacExpertEncodingNames[224] = {
NULL, "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior",
"commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", NULL, NULL, NULL, NULL,
};
-const FX_LPCSTR PDFDocEncodingNames[232] = {
+const FX_CHAR* const PDFDocEncodingNames[232] = {
"breve", "caron", "circumflex", "dotaccent", "hungarumlaut", "ogonek", "ring", "tilde",
"space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle",
"parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash",
@@ -415,7 +415,7 @@ const FX_LPCSTR PDFDocEncodingNames[232] = {
"eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide",
"oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis",
};
-const FX_LPCSTR AdobeSymbolEncodingNames[224] = {
+const FX_CHAR* const AdobeSymbolEncodingNames[224] = {
"space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat",
"parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash",
"zero", "one", "two", "three", "four", "five", "six", "seven",
@@ -445,7 +445,7 @@ const FX_LPCSTR AdobeSymbolEncodingNames[224] = {
NULL, "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex",
"parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", NULL,
};
-const FX_LPCSTR ZapfEncodingNames[224] = {
+const FX_CHAR* const ZapfEncodingNames[224] = {
"space", "a1", "a2", "a202", "a3", "a4", "a5", "a119",
"a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16",
"a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23",
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index a6209cb536..bec2c90144 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -13,7 +13,7 @@
extern FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode);
extern short TT2PDF(int m, FXFT_Face face);
extern FX_BOOL FT_UseTTCharmap(FXFT_Face face, int platform_id, int encoding_id);
-extern FX_LPCSTR GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode);
+extern const FX_CHAR* GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode);
CPDF_CMapManager::CPDF_CMapManager()
{
m_bPrompted = FALSE;
@@ -26,7 +26,7 @@ CPDF_CMapManager::~CPDF_CMapManager()
CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
{
CPDF_CMap* pCMap;
- if (m_CMaps.Lookup(name, (FX_LPVOID&)pCMap)) {
+ if (m_CMaps.Lookup(name, (void*&)pCMap)) {
return pCMap;
}
pCMap = LoadPredefinedCMap(name, bPromptCJK);
@@ -39,14 +39,14 @@ CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name, FX_BO
CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name, FX_BOOL bPromptCJK)
{
CPDF_CMap* pCMap = new CPDF_CMap;
- FX_LPCSTR pname = name;
+ const FX_CHAR* pname = name;
if (*pname == '/') {
pname ++;
}
pCMap->LoadPredefined(this, pname, bPromptCJK);
return pCMap;
}
-static const FX_LPCSTR g_CharsetNames[NUMBER_OF_CIDSETS] = {NULL, "GB1", "CNS1", "Japan1", "Korea1", "UCS" };
+static const FX_CHAR* const g_CharsetNames[NUMBER_OF_CIDSETS] = {NULL, "GB1", "CNS1", "Japan1", "Korea1", "UCS" };
static const int g_CharsetCPs[NUMBER_OF_CIDSETS] = {0, 936, 950, 932, 949, 1200 };
int _CharsetFromOrdering(const CFX_ByteString& Ordering)
{
@@ -66,7 +66,7 @@ void CPDF_CMapManager::DropAll(FX_BOOL bReload)
while (pos) {
CFX_ByteString name;
CPDF_CMap* pCMap;
- m_CMaps.GetNextAssoc(pos, name, (FX_LPVOID&)pCMap);
+ m_CMaps.GetNextAssoc(pos, name, (void*&)pCMap);
if (pCMap == NULL) {
continue;
}
@@ -347,7 +347,7 @@ const CPDF_PredefinedCMap g_PredefinedCMaps[] = {
};
extern void FPDFAPI_FindEmbeddedCMap(const char* name, int charset, int coding, const FXCMAP_CMap*& pMap);
extern FX_WORD FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode);
-FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, FX_LPCSTR pName, FX_BOOL bPromptCJK)
+FX_BOOL CPDF_CMap::LoadPredefined(CPDF_CMapManager* pMgr, const FX_CHAR* pName, FX_BOOL bPromptCJK)
{
m_PredefinedCMap = pName;
if (m_PredefinedCMap == FX_BSTRC("Identity-H") || m_PredefinedCMap == FX_BSTRC("Identity-V")) {
@@ -396,7 +396,7 @@ extern "C" {
return (*(FX_DWORD*)data1) - (*(FX_DWORD*)data2);
}
};
-FX_BOOL CPDF_CMap::LoadEmbedded(FX_LPCBYTE pData, FX_DWORD size)
+FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size)
{
m_pMapping = FX_Alloc(FX_WORD, 65536);
CPDF_CMapParser parser;
@@ -462,7 +462,7 @@ FX_WORD CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const
}
return (FX_WORD)CID;
}
-static int _CheckCodeRange(FX_LPBYTE codes, int size, _CMap_CodeRange* pRanges, int nRanges)
+static int _CheckCodeRange(uint8_t* codes, int size, _CMap_CodeRange* pRanges, int nRanges)
{
int iSeg = nRanges - 1;
while (iSeg >= 0) {
@@ -491,26 +491,26 @@ static int _CheckCodeRange(FX_LPBYTE codes, int size, _CMap_CodeRange* pRanges,
}
return 0;
}
-FX_DWORD CPDF_CMap::GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) const
+FX_DWORD CPDF_CMap::GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const
{
switch (m_CodingScheme) {
case OneByte:
- return ((FX_LPBYTE)pString)[offset++];
+ return ((uint8_t*)pString)[offset++];
case TwoBytes:
offset += 2;
- return ((FX_LPBYTE)pString)[offset - 2] * 256 + ((FX_LPBYTE)pString)[offset - 1];
+ return ((uint8_t*)pString)[offset - 2] * 256 + ((uint8_t*)pString)[offset - 1];
case MixedTwoBytes: {
- uint8_t byte1 = ((FX_LPBYTE)pString)[offset++];
+ uint8_t byte1 = ((uint8_t*)pString)[offset++];
if (!m_pLeadingBytes[byte1]) {
return byte1;
}
- uint8_t byte2 = ((FX_LPBYTE)pString)[offset++];
+ uint8_t byte2 = ((uint8_t*)pString)[offset++];
return byte1 * 256 + byte2;
}
case MixedFourBytes: {
uint8_t codes[4];
int char_size = 1;
- codes[0] = ((FX_LPBYTE)pString)[offset++];
+ codes[0] = ((uint8_t*)pString)[offset++];
_CMap_CodeRange* pRanges = (_CMap_CodeRange*)m_pLeadingBytes;
while (1) {
int ret = _CheckCodeRange(codes, char_size, pRanges, m_nCodeRanges);
@@ -527,7 +527,7 @@ FX_DWORD CPDF_CMap::GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) con
if (char_size == 4 || offset == nStrLen) {
return 0;
}
- codes[char_size ++] = ((FX_LPBYTE)pString)[offset++];
+ codes[char_size ++] = ((uint8_t*)pString)[offset++];
}
break;
}
@@ -556,7 +556,7 @@ int CPDF_CMap::GetCharSize(FX_DWORD charcode) const
}
return 1;
}
-int CPDF_CMap::CountChar(FX_LPCSTR pString, int size) const
+int CPDF_CMap::CountChar(const FX_CHAR* pString, int size) const
{
switch (m_CodingScheme) {
case OneByte:
@@ -567,7 +567,7 @@ int CPDF_CMap::CountChar(FX_LPCSTR pString, int size) const
int count = 0;
for (int i = 0; i < size; i ++) {
count ++;
- if (m_pLeadingBytes[((FX_LPBYTE)pString)[i]]) {
+ if (m_pLeadingBytes[((uint8_t*)pString)[i]]) {
i ++;
}
}
@@ -619,7 +619,7 @@ int _GetCharSize(FX_DWORD charcode, _CMap_CodeRange* pRanges, int iRangesSize)
}
return 1;
}
-int CPDF_CMap::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
+int CPDF_CMap::AppendChar(FX_CHAR* str, FX_DWORD charcode) const
{
switch (m_CodingScheme) {
case OneByte:
@@ -793,7 +793,7 @@ FX_WCHAR CPDF_CIDFont::_UnicodeFromCharCode(FX_DWORD charcode) const
charcode = (charcode % 256) * 256 + (charcode / 256);
charsize = 2;
}
- int ret = FXSYS_MultiByteToWideChar(g_CharsetCPs[m_pCMap->m_Coding], 0, (FX_LPCSTR)&charcode, charsize, &unicode, 1);
+ int ret = FXSYS_MultiByteToWideChar(g_CharsetCPs[m_pCMap->m_Coding], 0, (const FX_CHAR*)&charcode, charsize, &unicode, 1);
if (ret != 1) {
return 0;
}
@@ -1056,7 +1056,7 @@ void CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
}
if (m_pFontFile == NULL && m_Charset == CIDSET_JAPAN1) {
FX_WORD CID = CIDFromCharCode(charcode);
- FX_LPCBYTE pTransform = GetCIDTransform(CID);
+ const uint8_t* pTransform = GetCIDTransform(CID);
if (pTransform && !bVert) {
CFX_AffineMatrix matrix(_CIDTransformToFloat(pTransform[0]), _CIDTransformToFloat(pTransform[1]),
_CIDTransformToFloat(pTransform[2]), _CIDTransformToFloat(pTransform[3]),
@@ -1222,7 +1222,7 @@ int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
} else if (bMacRoman) {
iBaseEncoding = PDFFONT_ENCODING_MACROMAN;
}
- FX_LPCSTR name = GetAdobeCharName(iBaseEncoding, NULL, charcode);
+ const FX_CHAR* name = GetAdobeCharName(iBaseEncoding, NULL, charcode);
if (name == NULL) {
return charcode == 0 ? -1 : (int)charcode;
}
@@ -1314,10 +1314,10 @@ int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
if (byte_pos + 2 > m_pCIDToGIDMap->GetSize()) {
return -1;
}
- FX_LPCBYTE pdata = m_pCIDToGIDMap->GetData() + byte_pos;
+ const uint8_t* pdata = m_pCIDToGIDMap->GetData() + byte_pos;
return pdata[0] * 256 + pdata[1];
}
-FX_DWORD CPDF_CIDFont::GetNextChar(FX_LPCSTR pString, int nStrLen, int& offset) const
+FX_DWORD CPDF_CIDFont::GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const
{
return m_pCMap->GetNextChar(pString, nStrLen, offset);
}
@@ -1325,11 +1325,11 @@ int CPDF_CIDFont::GetCharSize(FX_DWORD charcode) const
{
return m_pCMap->GetCharSize(charcode);
}
-int CPDF_CIDFont::CountChar(FX_LPCSTR pString, int size) const
+int CPDF_CIDFont::CountChar(const FX_CHAR* pString, int size) const
{
return m_pCMap->CountChar(pString, size);
}
-int CPDF_CIDFont::AppendChar(FX_LPSTR str, FX_DWORD charcode) const
+int CPDF_CIDFont::AppendChar(FX_CHAR* str, FX_DWORD charcode) const
{
return m_pCMap->AppendChar(str, charcode);
}
@@ -1579,7 +1579,7 @@ Japan1_VertCIDs[] = {
{8818, 0, 129, 127, 0, 19, 114},
{8819, 0, 129, 127, 0, 218, 108},
};
-FX_LPCBYTE CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const
+const uint8_t* CPDF_CIDFont::GetCIDTransform(FX_WORD CID) const
{
if (m_Charset != CIDSET_JAPAN1 || m_pFontFile != NULL) {
return NULL;
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index ab15c47cb3..b6b2f57c02 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -48,7 +48,7 @@ void CFX_GlyphMap::SetAt(int key, int value)
}
FX_BOOL CFX_GlyphMap::Lookup(int key, int &value)
{
- FX_LPVOID pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair),
+ void* pResult = FXSYS_bsearch(&key, m_Buffer.GetBuffer(), m_Buffer.GetSize() / sizeof(_IntPair),
sizeof(_IntPair), _CompareInt);
if (pResult == NULL) {
return FALSE;