Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Unified Diff: xfa/fgas/crt/fgas_stream.cpp

Issue 1885973002: Remove implicit cast from CFX_ByteString to (const char*). (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Typo Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fgas/crt/fgas_codepage.cpp ('k') | xfa/fgas/font/fgas_stdfontmgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fgas/crt/fgas_stream.cpp
diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp
index 02fa2109d166c9a542adf8ce57ad3355a0ec6d48..1a3b23918472f03f6215a9753e5dc684cd34ae8b 100644
--- a/xfa/fgas/crt/fgas_stream.cpp
+++ b/xfa/fgas/crt/fgas_stream.cpp
@@ -420,7 +420,7 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
}
}
#else
- CFX_ByteString wsMode;
+ const FX_CHAR* wsMode = "rb";
if (dwAccess & FX_STREAMACCESS_Write) {
if (dwAccess & FX_STREAMACCESS_Append) {
wsMode = "a+b";
@@ -429,18 +429,16 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
} else {
wsMode = "r+b";
}
- } else {
- wsMode = "rb";
}
CFX_ByteString szFileName = CFX_ByteString::FromUnicode(pszSrcFileName);
- m_hFile = FXSYS_fopen(szFileName, wsMode);
+ m_hFile = FXSYS_fopen(szFileName.c_str(), wsMode);
if (m_hFile == NULL) {
if (dwAccess & FX_STREAMACCESS_Write) {
if (dwAccess & FX_STREAMACCESS_Create) {
- m_hFile = FXSYS_fopen(szFileName, "w+b");
+ m_hFile = FXSYS_fopen(szFileName.c_str(), "w+b");
}
if (m_hFile == NULL) {
- m_hFile = FXSYS_fopen(szFileName, "r+b");
+ m_hFile = FXSYS_fopen(szFileName.c_str(), "r+b");
if (m_hFile == NULL) {
return FALSE;
}
« no previous file with comments | « xfa/fgas/crt/fgas_codepage.cpp ('k') | xfa/fgas/font/fgas_stdfontmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698