summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-13 15:41:21 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-13 15:41:21 -0700
commitb4c9f3f04673753da30011e9f1282cd5d1fa0f40 (patch)
tree9890d43409c8d60b1041de921c961067907419fb /core
parentcdce75706de7e76e73550a0582e1fd28af324fd0 (diff)
downloadpdfium-b4c9f3f04673753da30011e9f1282cd5d1fa0f40.tar.xz
Remove implicit cast from CFX_ByteString to (const char*).
BUG= Review URL: https://codereview.chromium.org/1885973002
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_font.cpp2
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_type3font.cpp3
-rw-r--r--core/fpdfapi/fpdf_font/fpdf_font_cid.cpp4
-rw-r--r--core/fpdfapi/fpdf_page/cpdf_textobject.cpp9
-rw-r--r--core/fpdfapi/fpdf_parser/cfdf_document.cpp2
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp10
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_parser.cpp20
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp4
-rw-r--r--core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp2
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_text.cpp6
-rw-r--r--core/fpdfdoc/doc_basic.cpp2
-rw-r--r--core/fpdfdoc/doc_form.cpp4
-rw-r--r--core/fpdfdoc/doc_utils.cpp4
-rw-r--r--core/fpdftext/fpdf_text_int.cpp2
-rw-r--r--core/fxcrt/fx_basic_bstring.cpp2
-rw-r--r--core/fxcrt/fx_basic_gcc.cpp4
-rw-r--r--core/fxcrt/fx_basic_util.cpp8
-rw-r--r--core/fxcrt/include/fx_string.h3
-rw-r--r--core/fxge/apple/fx_mac_imp.cpp2
-rw-r--r--core/fxge/ge/fx_ge_fontmap.cpp26
-rw-r--r--core/fxge/win32/fx_win32_device.cpp7
-rw-r--r--core/fxge/win32/fx_win32_gdipext.cpp2
22 files changed, 64 insertions, 64 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp
index 7a6043ad87..3dfadeda9e 100644
--- a/core/fpdfapi/fpdf_font/cpdf_font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp
@@ -485,7 +485,7 @@ const FX_CHAR* CPDF_Font::GetAdobeCharName(int iBaseEncoding,
const FX_CHAR* name = nullptr;
if (pCharNames)
- name = pCharNames[charcode];
+ name = pCharNames[charcode].c_str();
if ((!name || name[0] == 0) && iBaseEncoding)
name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode);
return name && name[0] ? name : nullptr;
diff --git a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
index 92f5102cdb..40fb54fbc7 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
@@ -73,7 +73,8 @@ FX_BOOL CPDF_Type3Font::Load() {
LoadPDFEncoding(pEncoding, m_BaseEncoding, m_pCharNames, FALSE, FALSE);
if (m_pCharNames) {
for (int i = 0; i < 256; i++) {
- m_Encoding.m_Unicodes[i] = PDF_UnicodeFromAdobeName(m_pCharNames[i]);
+ m_Encoding.m_Unicodes[i] =
+ PDF_UnicodeFromAdobeName(m_pCharNames[i].c_str());
if (m_Encoding.m_Unicodes[i] == 0) {
m_Encoding.m_Unicodes[i] = i;
}
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index da6b8de35b..f84fa9f2f9 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -304,7 +304,7 @@ CPDF_CMap* CPDF_CMapManager::GetPredefinedCMap(const CFX_ByteString& name,
CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name,
FX_BOOL bPromptCJK) {
CPDF_CMap* pCMap = new CPDF_CMap;
- const FX_CHAR* pname = name;
+ const FX_CHAR* pname = name.c_str();
if (*pname == '/') {
pname++;
}
@@ -315,7 +315,7 @@ CPDF_CMap* CPDF_CMapManager::LoadPredefinedCMap(const CFX_ByteString& name,
void CPDF_CMapManager::ReloadAll() {
for (const auto& pair : m_CMaps) {
CPDF_CMap* pCMap = pair.second;
- pCMap->LoadPredefined(this, pair.first, FALSE);
+ pCMap->LoadPredefined(this, pair.first.c_str(), FALSE);
}
for (size_t i = 0; i < FX_ArraySize(m_CID2UnicodeMaps); ++i) {
if (CPDF_CID2UnicodeMap* pMap = m_CID2UnicodeMaps[i]) {
diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
index 444101fb9e..a3fbbad8b0 100644
--- a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
@@ -142,7 +142,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
CPDF_Font* pFont = m_TextState.GetFont();
m_nChars = 0;
for (int i = 0; i < nsegs; ++i) {
- m_nChars += pFont->CountChar(pStrs[i], pStrs[i].GetLength());
+ m_nChars += pFont->CountChar(pStrs[i].c_str(), pStrs[i].GetLength());
}
m_nChars += nsegs - 1;
if (m_nChars > 1) {
@@ -150,8 +150,9 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
int index = 0;
for (int i = 0; i < nsegs; ++i) {
- const FX_CHAR* segment = pStrs[i];
- int offset = 0, len = pStrs[i].GetLength();
+ const FX_CHAR* segment = pStrs[i].c_str();
+ int len = pStrs[i].GetLength();
+ int offset = 0;
while (offset < len) {
m_pCharCodes[index++] = pFont->GetNextChar(segment, len, offset);
}
@@ -163,7 +164,7 @@ void CPDF_TextObject::SetSegments(const CFX_ByteString* pStrs,
} else {
int offset = 0;
m_pCharCodes = (uint32_t*)(uintptr_t)pFont->GetNextChar(
- pStrs[0], pStrs[0].GetLength(), offset);
+ pStrs[0].c_str(), pStrs[0].GetLength(), offset);
}
}
diff --git a/core/fpdfapi/fpdf_parser/cfdf_document.cpp b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
index 9cbf999702..3039c32938 100644
--- a/core/fpdfapi/fpdf_parser/cfdf_document.cpp
+++ b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
@@ -53,7 +53,7 @@ void CFDF_Document::ParseStream(IFX_FileRead* pFile, FX_BOOL bOwnFile) {
bool bNumber;
CFX_ByteString word = parser.GetNextWord(&bNumber);
if (bNumber) {
- uint32_t objnum = FXSYS_atoui(word);
+ uint32_t objnum = FXSYS_atoui(word.c_str());
word = parser.GetNextWord(&bNumber);
if (!bNumber) {
break;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
index e08e913f74..f210c49c71 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
@@ -792,7 +792,7 @@ CPDF_Object* CPDF_DataAvail::ParseIndirectObjectAt(
if (!bIsNumber)
return nullptr;
- uint32_t parser_objnum = FXSYS_atoui(word);
+ uint32_t parser_objnum = FXSYS_atoui(word.c_str());
if (objnum && parser_objnum != objnum)
return nullptr;
@@ -800,7 +800,7 @@ CPDF_Object* CPDF_DataAvail::ParseIndirectObjectAt(
if (!bIsNumber)
return nullptr;
- uint32_t gennum = FXSYS_atoui(word);
+ uint32_t gennum = FXSYS_atoui(word.c_str());
if (m_syntaxParser.GetKeyword() != "obj") {
m_syntaxParser.RestorePos(SavedPos);
return nullptr;
@@ -849,7 +849,7 @@ FX_BOOL CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, uint32_t dwLen) {
if (!bNumber)
return FALSE;
- uint32_t objnum = FXSYS_atoui(wordObjNum);
+ uint32_t objnum = FXSYS_atoui(wordObjNum.c_str());
if (m_pLinearized) {
m_pLinearized->Release();
m_pLinearized = nullptr;
@@ -901,7 +901,7 @@ FX_BOOL CPDF_DataAvail::CheckEnd(IPDF_DataAvail::DownloadHints* pHints) {
return FALSE;
}
- m_dwXRefOffset = (FX_FILESIZE)FXSYS_atoi64(xrefpos_str);
+ m_dwXRefOffset = (FX_FILESIZE)FXSYS_atoi64(xrefpos_str.c_str());
if (!m_dwXRefOffset || m_dwXRefOffset > m_dwFileLen) {
m_docStatus = PDF_DATAAVAIL_LOADALLFILE;
return TRUE;
@@ -943,7 +943,7 @@ int32_t CPDF_DataAvail::CheckCrossRefStream(
if (!bNumber)
return -1;
- uint32_t objNum = FXSYS_atoui(objnum);
+ uint32_t objNum = FXSYS_atoui(objnum.c_str());
CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(nullptr, 0, objNum);
if (!pObj) {
m_Pos += m_parser.m_pSyntax->SavePos();
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
index f1816f2028..d6531f5184 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
@@ -202,7 +202,7 @@ CPDF_Parser::Error CPDF_Parser::StartParse(IFX_FileRead* pFileAccess) {
if (!bNumber)
return FORMAT_ERROR;
- m_LastXRefOffset = (FX_FILESIZE)FXSYS_atoi64(xrefpos_str);
+ m_LastXRefOffset = (FX_FILESIZE)FXSYS_atoi64(xrefpos_str.c_str());
if (!LoadAllCrossRefV4(m_LastXRefOffset) &&
!LoadAllCrossRefV5(m_LastXRefOffset)) {
if (!RebuildCrossRef())
@@ -505,7 +505,7 @@ bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos,
break;
}
- uint32_t start_objnum = FXSYS_atoui(word);
+ uint32_t start_objnum = FXSYS_atoui(word.c_str());
if (start_objnum >= kMaxObjectNumber)
return false;
@@ -846,7 +846,7 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() {
CFX_ByteString bsOffset =
m_pSyntax->GetNextWord(&bNumber);
if (bNumber)
- m_LastXRefOffset = FXSYS_atoi(bsOffset);
+ m_LastXRefOffset = FXSYS_atoi(bsOffset.c_str());
}
m_pSyntax->RestorePos(dwSavePos);
}
@@ -1293,7 +1293,7 @@ void CPDF_Parser::GetIndirectBinary(uint32_t objnum,
return;
}
- uint32_t parser_objnum = FXSYS_atoui(word);
+ uint32_t parser_objnum = FXSYS_atoui(word.c_str());
if (parser_objnum && parser_objnum != objnum) {
m_pSyntax->RestorePos(SavedPos);
return;
@@ -1365,7 +1365,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObjectAt(
FX_FILESIZE objOffset = m_pSyntax->SavePos();
objOffset -= word.GetLength();
- uint32_t parser_objnum = FXSYS_atoui(word);
+ uint32_t parser_objnum = FXSYS_atoui(word.c_str());
if (objnum && parser_objnum != objnum) {
m_pSyntax->RestorePos(SavedPos);
return nullptr;
@@ -1377,7 +1377,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObjectAt(
return nullptr;
}
- uint32_t parser_gennum = FXSYS_atoui(word);
+ uint32_t parser_gennum = FXSYS_atoui(word.c_str());
if (m_pSyntax->GetKeyword() != "obj") {
m_pSyntax->RestorePos(SavedPos);
return nullptr;
@@ -1415,7 +1415,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObjectAtByStrict(
return nullptr;
}
- uint32_t parser_objnum = FXSYS_atoui(word);
+ uint32_t parser_objnum = FXSYS_atoui(word.c_str());
if (objnum && parser_objnum != objnum) {
m_pSyntax->RestorePos(SavedPos);
return nullptr;
@@ -1427,7 +1427,7 @@ CPDF_Object* CPDF_Parser::ParseIndirectObjectAtByStrict(
return nullptr;
}
- uint32_t gennum = FXSYS_atoui(word);
+ uint32_t gennum = FXSYS_atoui(word.c_str());
if (m_pSyntax->GetKeyword() != "obj") {
m_pSyntax->RestorePos(SavedPos);
return nullptr;
@@ -1477,12 +1477,12 @@ FX_BOOL CPDF_Parser::IsLinearizedFile(IFX_FileRead* pFileAccess,
if (!bIsNumber)
return FALSE;
- uint32_t objnum = FXSYS_atoui(word);
+ uint32_t objnum = FXSYS_atoui(word.c_str());
word = m_pSyntax->GetNextWord(&bIsNumber);
if (!bIsNumber)
return FALSE;
- uint32_t gennum = FXSYS_atoui(word);
+ uint32_t gennum = FXSYS_atoui(word.c_str());
if (m_pSyntax->GetKeyword() != "obj") {
m_pSyntax->RestorePos(SavedPos);
return FALSE;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
index 0190c6e692..16daba184d 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
@@ -394,7 +394,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjectHolder* pObjList,
if (bIsNumber) {
CFX_ByteString nextword2 = GetNextWord(nullptr);
if (nextword2 == "R") {
- uint32_t objnum = FXSYS_atoui(word);
+ uint32_t objnum = FXSYS_atoui(word.c_str());
return new CPDF_Reference(pObjList, objnum);
}
}
@@ -518,7 +518,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(
if (bIsNumber) {
CFX_ByteString nextword2 = GetNextWord(nullptr);
if (nextword2 == "R")
- return new CPDF_Reference(pObjList, FXSYS_atoui(word));
+ return new CPDF_Reference(pObjList, FXSYS_atoui(word.c_str()));
}
m_Pos = SavedPos;
return new CPDF_Number(word.AsStringC());
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index bfd0de44b6..466ccaffa5 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -112,7 +112,7 @@ CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig) {
if (!FXSYS_memchr(orig.c_str(), '#', orig.GetLength())) {
return orig;
}
- return PDF_NameDecode(CFX_ByteStringC(orig));
+ return PDF_NameDecode(orig.AsStringC());
}
CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) {
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 264abe9a53..ff8df7685d 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -637,7 +637,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
FX_ARGB stroke_argb,
const CFX_GraphStateData* pGraphState,
const CPDF_RenderOptions* pOptions) {
- int nChars = pFont->CountChar(str, str.GetLength());
+ int nChars = pFont->CountChar(str.c_str(), str.GetLength());
if (nChars == 0) {
return;
}
@@ -646,7 +646,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
uint32_t* pCharCodes;
FX_FLOAT* pCharPos;
if (nChars == 1) {
- charcode = pFont->GetNextChar(str, str.GetLength(), offset);
+ charcode = pFont->GetNextChar(str.c_str(), str.GetLength(), offset);
pCharCodes = (uint32_t*)(uintptr_t)charcode;
pCharPos = NULL;
} else {
@@ -654,7 +654,7 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
pCharPos = FX_Alloc(FX_FLOAT, nChars - 1);
FX_FLOAT cur_pos = 0;
for (int i = 0; i < nChars; i++) {
- pCharCodes[i] = pFont->GetNextChar(str, str.GetLength(), offset);
+ pCharCodes[i] = pFont->GetNextChar(str.c_str(), str.GetLength(), offset);
if (i) {
pCharPos[i - 1] = cur_pos;
}
diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp
index e0b71df392..6d6e5c234f 100644
--- a/core/fpdfdoc/doc_basic.cpp
+++ b/core/fpdfdoc/doc_basic.cpp
@@ -511,7 +511,7 @@ int32_t CPDF_PageLabel::GetPageByLabel(const CFX_ByteStringC& bsLabel) const {
}
}
bsLbl = bsOrig;
- int nPage = FXSYS_atoi(bsLbl);
+ int nPage = FXSYS_atoi(bsLbl.c_str());
if (nPage > 0 && nPage <= nPages) {
return nPage;
}
diff --git a/core/fpdfdoc/doc_form.cpp b/core/fpdfdoc/doc_form.cpp
index 207b824545..6ca40fdaf6 100644
--- a/core/fpdfdoc/doc_form.cpp
+++ b/core/fpdfdoc/doc_form.cpp
@@ -633,11 +633,11 @@ FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl,
}
int CPDF_InterForm::CompareFieldName(const CFX_ByteString& name1,
const CFX_ByteString& name2) {
- const FX_CHAR* ptr1 = name1;
- const FX_CHAR* ptr2 = name2;
if (name1.GetLength() == name2.GetLength()) {
return name1 == name2 ? 1 : 0;
}
+ const FX_CHAR* ptr1 = name1.c_str();
+ const FX_CHAR* ptr2 = name2.c_str();
int i = 0;
while (ptr1[i] == ptr2[i]) {
i++;
diff --git a/core/fpdfdoc/doc_utils.cpp b/core/fpdfdoc/doc_utils.cpp
index 404353847f..2df7d97e31 100644
--- a/core/fpdfdoc/doc_utils.cpp
+++ b/core/fpdfdoc/doc_utils.cpp
@@ -603,8 +603,8 @@ void AddInterFormFont(CPDF_Dictionary*& pFormDict,
csNameTag = pFont->GetBaseFont();
}
csNameTag.Remove(' ');
- csNameTag =
- CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4, csNameTag);
+ csNameTag = CPDF_InterForm::GenerateNewResourceName(pDR, "Font", 4,
+ csNameTag.c_str());
pFonts->SetAtReference(csNameTag.AsStringC(), pDocument,
pFont->GetFontDict());
}
diff --git a/core/fpdftext/fpdf_text_int.cpp b/core/fpdftext/fpdf_text_int.cpp
index 8d8fa4e9ed..a1e3fda7b1 100644
--- a/core/fpdftext/fpdf_text_int.cpp
+++ b/core/fpdftext/fpdf_text_int.cpp
@@ -906,7 +906,7 @@ int CPDF_TextPage::GetCharWidth(uint32_t charCode, CPDF_Font* pFont) const {
CFX_ByteString str;
pFont->AppendChar(str, charCode);
- if (int w = pFont->GetStringWidth(str, 1))
+ if (int w = pFont->GetStringWidth(str.c_str(), 1))
return w;
return pFont->GetCharBBox(charCode).Width();
diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp
index 23fdcaa25e..bfa0cbd98c 100644
--- a/core/fxcrt/fx_basic_bstring.cpp
+++ b/core/fxcrt/fx_basic_bstring.cpp
@@ -921,7 +921,7 @@ void CFX_ByteString::TrimLeft() {
}
uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const {
- return CFX_ByteStringC(*this).GetID(start_pos);
+ return AsStringC().GetID(start_pos);
}
uint32_t CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const {
if (m_Length == 0) {
diff --git a/core/fxcrt/fx_basic_gcc.cpp b/core/fxcrt/fx_basic_gcc.cpp
index c3afe1115b..ddbdcd5881 100644
--- a/core/fxcrt/fx_basic_gcc.cpp
+++ b/core/fxcrt/fx_basic_gcc.cpp
@@ -133,8 +133,8 @@ uint32_t FXSYS_GetModuleFileName(void* hModule, char* buf, uint32_t bufsize) {
extern "C" {
#endif
FXSYS_FILE* FXSYS_wfopen(const FX_WCHAR* filename, const FX_WCHAR* mode) {
- return FXSYS_fopen(CFX_ByteString::FromUnicode(filename),
- CFX_ByteString::FromUnicode(mode));
+ return FXSYS_fopen(CFX_ByteString::FromUnicode(filename).c_str(),
+ CFX_ByteString::FromUnicode(mode).c_str());
}
char* FXSYS_strlwr(char* str) {
if (!str) {
diff --git a/core/fxcrt/fx_basic_util.cpp b/core/fxcrt/fx_basic_util.cpp
index 4374dec779..1cf966589d 100644
--- a/core/fxcrt/fx_basic_util.cpp
+++ b/core/fxcrt/fx_basic_util.cpp
@@ -210,9 +210,9 @@ void* FX_OpenFolder(const FX_CHAR* path) {
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
#ifndef _WIN32_WCE
CFindFileDataA* pData = new CFindFileDataA;
- pData->m_Handle =
- FindFirstFileExA(CFX_ByteString(path) + "/*.*", FindExInfoStandard,
- &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
+ pData->m_Handle = FindFirstFileExA((CFX_ByteString(path) + "/*.*").c_str(),
+ FindExInfoStandard, &pData->m_FindData,
+ FindExSearchNameMatch, NULL, 0);
#else
CFindFileDataW* pData = new CFindFileDataW;
pData->m_Handle = FindFirstFileW(CFX_WideString::FromLocal(path) + L"/*.*",
@@ -242,7 +242,7 @@ void* FX_OpenFolder(const FX_WCHAR* path) {
pData->m_bEnd = FALSE;
return pData;
#else
- DIR* dir = opendir(CFX_ByteString::FromUnicode(path));
+ DIR* dir = opendir(CFX_ByteString::FromUnicode(path).c_str());
return dir;
#endif
}
diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h
index ef0dfee6fb..4b73551573 100644
--- a/core/fxcrt/include/fx_string.h
+++ b/core/fxcrt/include/fx_string.h
@@ -170,9 +170,6 @@ class CFX_ByteString {
// Note: Any subsequent modification of |this| will invalidate the result.
const FX_CHAR* c_str() const { return m_pData ? m_pData->m_String : ""; }
- // Implicit conversion to C-style string -- deprecated.
- operator const FX_CHAR*() const { return m_pData ? m_pData->m_String : ""; }
-
// Explicit conversion to uint8_t*.
// Note: Any subsequent modification of |this| will invalidate the result.
const uint8_t* raw_str() const {
diff --git a/core/fxge/apple/fx_mac_imp.cpp b/core/fxge/apple/fx_mac_imp.cpp
index aae3f71b39..82b5078565 100644
--- a/core/fxge/apple/fx_mac_imp.cpp
+++ b/core/fxge/apple/fx_mac_imp.cpp
@@ -64,7 +64,7 @@ void* CFX_MacFontInfo::MapFont(int weight,
break;
}
if (iBaseFont < 12) {
- return GetFont(face);
+ return GetFont(face.c_str());
}
auto it = m_FontList.find(face);
if (it != m_FontList.end())
diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp
index 8f9dad837e..194f91034d 100644
--- a/core/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/fxge/ge/fx_ge_fontmap.cpp
@@ -758,11 +758,11 @@ void CFX_FontMapper::AddInstalledFont(const CFX_ByteString& name, int charset) {
}
if (bLocalized) {
- void* hFont = m_pFontInfo->GetFont(name);
+ void* hFont = m_pFontInfo->GetFont(name.c_str());
if (!hFont) {
int iExact;
- hFont =
- m_pFontInfo->MapFont(0, 0, FXFONT_DEFAULT_CHARSET, 0, name, iExact);
+ hFont = m_pFontInfo->MapFont(0, 0, FXFONT_DEFAULT_CHARSET, 0,
+ name.c_str(), iExact);
if (!hFont)
return;
}
@@ -796,7 +796,7 @@ CFX_ByteString CFX_FontMapper::MatchInstalledFonts(
LoadInstalledFonts();
int i;
for (i = pdfium::CollectionSize<int>(m_InstalledTTFonts) - 1; i >= 0; i--) {
- CFX_ByteString norm1 = TT_NormalizeName(m_InstalledTTFonts[i]);
+ CFX_ByteString norm1 = TT_NormalizeName(m_InstalledTTFonts[i].c_str());
if (norm1 == norm_name) {
break;
}
@@ -972,7 +972,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
}
if (!style.IsEmpty()) {
int nLen = style.GetLength();
- const FX_CHAR* pStyle = style;
+ const FX_CHAR* pStyle = style.c_str();
int i = 0;
FX_BOOL bFirstItem = TRUE;
CFX_ByteString buf;
@@ -1045,10 +1045,10 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
PitchFamily);
}
family = GetFontFamily(family, nStyle);
- CFX_ByteString match = MatchInstalledFonts(TT_NormalizeName(family));
+ CFX_ByteString match = MatchInstalledFonts(TT_NormalizeName(family.c_str()));
if (match.IsEmpty() && family != SubstName &&
(!bHasComma && (!bHasHypen || (bHasHypen && !bStyleAvail)))) {
- match = MatchInstalledFonts(TT_NormalizeName(SubstName));
+ match = MatchInstalledFonts(TT_NormalizeName(SubstName.c_str()));
}
if (match.IsEmpty() && iBaseFont >= 12) {
if (!bCJK) {
@@ -1104,7 +1104,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
}
iExact = !match.IsEmpty();
void* hFont = m_pFontInfo->MapFont(weight, bItalic, Charset, PitchFamily,
- family, iExact);
+ family.c_str(), iExact);
if (iExact) {
pSubstFont->m_SubstFlags |= FXFONT_SUBST_EXACT;
}
@@ -1123,7 +1123,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
weight = old_weight;
}
if (!match.IsEmpty()) {
- hFont = m_pFontInfo->GetFont(match);
+ hFont = m_pFontInfo->GetFont(match.c_str());
if (!hFont) {
return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight,
PitchFamily);
@@ -1165,7 +1165,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
return UseInternalSubst(pSubstFont, iBaseFont, italic_angle, old_weight,
PitchFamily);
}
- hFont = m_pFontInfo->GetFont(it->name);
+ hFont = m_pFontInfo->GetFont(it->name.c_str());
}
}
pSubstFont->m_ExtHandle = m_pFontInfo->RetainFont(hFont);
@@ -1381,7 +1381,7 @@ FX_BOOL CFX_FolderFontInfo::EnumFontList(CFX_FontMapper* pMapper) {
return TRUE;
}
void CFX_FolderFontInfo::ScanPath(const CFX_ByteString& path) {
- void* handle = FX_OpenFolder(path);
+ void* handle = FX_OpenFolder(path.c_str());
if (!handle)
return;
@@ -1412,7 +1412,7 @@ void CFX_FolderFontInfo::ScanPath(const CFX_ByteString& path) {
}
void CFX_FolderFontInfo::ScanFile(const CFX_ByteString& path) {
- FXSYS_FILE* pFile = FXSYS_fopen(path, "rb");
+ FXSYS_FILE* pFile = FXSYS_fopen(path.c_str(), "rb");
if (!pFile)
return;
@@ -1616,7 +1616,7 @@ uint32_t CFX_FolderFontInfo::GetFontData(void* hFont,
if (!datasize || size < datasize)
return datasize;
- FXSYS_FILE* pFile = FXSYS_fopen(pFont->m_FilePath, "rb");
+ FXSYS_FILE* pFile = FXSYS_fopen(pFont->m_FilePath.c_str(), "rb");
if (!pFile)
return 0;
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 60ae57c767..f8057e7d5d 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -350,7 +350,7 @@ void* CFX_Win32FontInfo::MapFont(int weight,
}
HFONT hFont =
::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset,
- OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face);
+ OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face.c_str());
char facebuf[100];
HFONT hOldFont = (HFONT)::SelectObject(m_hDC, hFont);
::GetTextFaceA(m_hDC, 100, facebuf);
@@ -393,8 +393,9 @@ void* CFX_Win32FontInfo::MapFont(int weight,
}
break;
}
- hFont = ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset,
- OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face);
+ hFont =
+ ::CreateFontA(-10, 0, 0, 0, weight, bItalic, 0, 0, charset,
+ OUT_TT_ONLY_PRECIS, 0, 0, subst_pitch_family, face.c_str());
return hFont;
}
void CFX_Win32FontInfo::DeleteFont(void* hFont) {
diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp
index 4e52a8941a..15f0972bba 100644
--- a/core/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/fxge/win32/fx_win32_gdipext.cpp
@@ -686,7 +686,7 @@ void CGdiplusExt::Load() {
strPlusPath += buf;
strPlusPath += "\\";
strPlusPath += "GDIPLUS.DLL";
- m_hModule = LoadLibraryA(strPlusPath);
+ m_hModule = LoadLibraryA(strPlusPath.c_str());
if (!m_hModule) {
return;
}