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

Unified Diff: fpdfsdk/fpdfxfa/fpdfxfa_doc.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 | « fpdfsdk/fpdfppo.cpp ('k') | fpdfsdk/fsdk_actionhandler.cpp » ('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 7fa258c50658525b4ad03a7246fcb2b516832de5..53068d345dd5cc8648db4b653ab5d97612253f75 100644
--- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp
@@ -39,7 +39,6 @@
#ifndef _WIN32
extern void SetLastError(int err);
-
extern int GetLastError();
#endif
@@ -655,7 +654,7 @@ void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc,
CFX_ByteString content;
if (fileType == FXFA_SAVEAS_XML) {
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
- fileWrite.WriteBlock((const FX_CHAR*)content, fileWrite.GetSize(),
+ fileWrite.WriteBlock(content.c_str(), fileWrite.GetSize(),
content.GetLength());
CFX_WideStringC data(L"data");
if (m_pXFADocView->GetDoc()->SavePackage(data, &fileWrite)) {
@@ -698,13 +697,13 @@ void CPDFXFA_Document::ExportData(CXFA_FFDoc* hDoc,
} else {
if (i == size - 1) {
CFX_WideString wPath = CFX_WideString::FromUTF16LE(
- (unsigned short*)(const FX_CHAR*)bs,
+ reinterpret_cast<const unsigned short*>(bs.c_str()),
bs.GetLength() / sizeof(unsigned short));
CFX_ByteString bPath = wPath.UTF8Encode();
- CFX_ByteString szFormat =
+ const char* szFormat =
"\n<pdf href=\"%s\" xmlns=\"http://ns.adobe.com/xdp/pdf/\"/>";
- content.Format(szFormat, (char*)(const FX_CHAR*)bPath);
- fileWrite.WriteBlock((const FX_CHAR*)content, fileWrite.GetSize(),
+ content.Format(szFormat, bPath.c_str());
+ fileWrite.WriteBlock(content.c_str(), fileWrite.GetSize(),
content.GetLength());
}
@@ -954,8 +953,8 @@ FX_BOOL CPDFXFA_Document::_ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler,
if (fileType == FXFA_SAVEAS_XML) {
CFX_WideString ws;
ws.FromLocal("data");
- CFX_ByteString content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
- fileStream.WriteBlock((const FX_CHAR*)content, 0, content.GetLength());
+ const char* content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
+ fileStream.WriteBlock(content, 0, strlen(content));
m_pXFADoc->SavePackage(ws.AsStringC(), &fileStream);
} else if (fileType == FXFA_SAVEAS_XDP) {
if (flag == 0)
« no previous file with comments | « fpdfsdk/fpdfppo.cpp ('k') | fpdfsdk/fsdk_actionhandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698