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

Unified Diff: fpdfsdk/fpdfxfa/fpdfxfa_doc.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 | « fpdfsdk/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/fpdfxfa/include/fpdfxfa_app.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
index deba943072872c77f6e230cba7c416e92b0ca5d5..b2f752e8b91a8c6f5a62df8fbd5a7d0b9eb5e3ca 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
@@ -625,21 +625,22 @@ void CPDFXFA_Document::SetTitle(CXFA_FFDoc* hDoc,
}
void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFilePath,
+ const CFX_WideString& wsFilePath,
FX_BOOL bXDP) {
if (hDoc != m_pXFADoc)
return;
+
if (m_iDocType != DOCTYPE_DYNAMIC_XFA && m_iDocType != DOCTYPE_STATIC_XFA)
return;
+
CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
- if (pEnv == NULL)
+ if (!pEnv)
return;
- int fileType = bXDP ? FXFA_SAVEAS_XDP : FXFA_SAVEAS_XML;
- CFX_ByteString bs = CFX_WideString(wsFilePath).UTF16LE_Encode();
+ int fileType = bXDP ? FXFA_SAVEAS_XDP : FXFA_SAVEAS_XML;
+ CFX_ByteString bs = wsFilePath.UTF16LE_Encode();
if (wsFilePath.IsEmpty()) {
- if (!pEnv->GetFormFillInfo() ||
- pEnv->GetFormFillInfo()->m_pJsPlatform == NULL)
+ if (!pEnv->GetFormFillInfo() || !pEnv->GetFormFillInfo()->m_pJsPlatform)
return;
CFX_WideString filepath = pEnv->JS_fieldBrowse();
bs = filepath.UTF16LE_Encode();
@@ -649,12 +650,10 @@ void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc,
bXDP ? FXFA_SAVEAS_XDP : FXFA_SAVEAS_XML,
(FPDF_WIDESTRING)bs.GetBuffer(len * sizeof(unsigned short)), "wb");
bs.ReleaseBuffer(len * sizeof(unsigned short));
-
- if (pFileHandler == NULL)
+ if (!pFileHandler)
return;
CFPDF_FileStream fileWrite(pFileHandler);
-
CFX_ByteString content;
if (fileType == FXFA_SAVEAS_XML) {
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
@@ -725,10 +724,10 @@ void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc,
}
}
void CPDFXFA_Document::ImportData(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& wsFilePath) {}
+ const CFX_WideString& wsFilePath) {}
void CPDFXFA_Document::GotoURL(CXFA_FFDoc* hDoc,
- const CFX_WideStringC& bsURL,
+ const CFX_WideString& bsURL,
FX_BOOL bAppend) {
if (hDoc != m_pXFADoc)
return;
« no previous file with comments | « fpdfsdk/fpdfxfa/fpdfxfa_app.cpp ('k') | fpdfsdk/fpdfxfa/include/fpdfxfa_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698