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

Unified Diff: fpdfsdk/fpdfxfa/fpdfxfa_app.cpp

Issue 1983683003: Remove some c_str() calls from StringCs in xfa docs. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
index f9c3ca65a3f204125a81f25b068202b572e4f7fb..e91bdf169975d4eaa1b551481300d24ac7fa0a74 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_app.cpp
@@ -131,8 +131,8 @@ void CPDFXFA_App::Beep(uint32_t dwType) {
}
}
-int32_t CPDFXFA_App::MsgBox(const CFX_WideStringC& wsMessage,
- const CFX_WideStringC& wsTitle,
+int32_t CPDFXFA_App::MsgBox(const CFX_WideString& wsMessage,
+ const CFX_WideString& wsTitle,
uint32_t dwIconType,
uint32_t dwButtonType) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
@@ -184,11 +184,11 @@ int32_t CPDFXFA_App::MsgBox(const CFX_WideStringC& wsMessage,
return XFA_IDYes;
}
-void CPDFXFA_App::Response(CFX_WideString& wsAnswer,
- const CFX_WideStringC& wsQuestion,
- const CFX_WideStringC& wsTitle,
- const CFX_WideStringC& wsDefaultAnswer,
- FX_BOOL bMark) {
+CFX_WideString CPDFXFA_App::Response(const CFX_WideString& wsQuestion,
+ const CFX_WideString& wsTitle,
+ const CFX_WideString& wsDefaultAnswer,
+ FX_BOOL bMark) {
+ CFX_WideString wsAnswer;
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
if (pEnv) {
int nLength = 2048;
@@ -206,6 +206,7 @@ void CPDFXFA_App::Response(CFX_WideString& wsAnswer,
}
delete[] pBuff;
}
+ return wsAnswer;
}
int32_t CPDFXFA_App::GetCurDocumentInBatch() {
@@ -225,39 +226,34 @@ int32_t CPDFXFA_App::GetDocumentCountInBatch() {
return 0;
}
-IFX_FileRead* CPDFXFA_App::DownloadURL(const CFX_WideStringC& wsURL) {
+IFX_FileRead* CPDFXFA_App::DownloadURL(const CFX_WideString& wsURL) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
- if (pEnv) {
- return pEnv->FFI_DownloadFromURL(wsURL.c_str());
- }
- return NULL;
+ return pEnv ? pEnv->FFI_DownloadFromURL(wsURL.c_str()) : nullptr;
}
-FX_BOOL CPDFXFA_App::PostRequestURL(const CFX_WideStringC& wsURL,
- const CFX_WideStringC& wsData,
- const CFX_WideStringC& wsContentType,
- const CFX_WideStringC& wsEncode,
- const CFX_WideStringC& wsHeader,
+FX_BOOL CPDFXFA_App::PostRequestURL(const CFX_WideString& wsURL,
+ const CFX_WideString& wsData,
+ const CFX_WideString& wsContentType,
+ const CFX_WideString& wsEncode,
+ const CFX_WideString& wsHeader,
CFX_WideString& wsResponse) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
- if (pEnv) {
- wsResponse = pEnv->FFI_PostRequestURL(wsURL.c_str(), wsData.c_str(),
- wsContentType.c_str(),
- wsEncode.c_str(), wsHeader.c_str());
- return TRUE;
- }
- return FALSE;
+ if (!pEnv)
+ return FALSE;
+
+ wsResponse = pEnv->FFI_PostRequestURL(wsURL.c_str(), wsData.c_str(),
+ wsContentType.c_str(), wsEncode.c_str(),
+ wsHeader.c_str());
+ return TRUE;
}
-FX_BOOL CPDFXFA_App::PutRequestURL(const CFX_WideStringC& wsURL,
- const CFX_WideStringC& wsData,
- const CFX_WideStringC& wsEncode) {
+FX_BOOL CPDFXFA_App::PutRequestURL(const CFX_WideString& wsURL,
+ const CFX_WideString& wsData,
+ const CFX_WideString& wsEncode) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
- if (pEnv) {
- return pEnv->FFI_PutRequestURL(wsURL.c_str(), wsData.c_str(),
- wsEncode.c_str());
- }
- return FALSE;
+ return pEnv &&
+ pEnv->FFI_PutRequestURL(wsURL.c_str(), wsData.c_str(),
+ wsEncode.c_str());
}
void CPDFXFA_App::LoadString(int32_t iStringID, CFX_WideString& wsString) {
« no previous file with comments | « no previous file | fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698