Chromium Code Reviews| Index: fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp |
| diff --git a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp |
| index aa1a1a82c77dbf71d89e4b9c853646c891f4bb43..3926984dcce7c842cfc99be90e71e58b943d378a 100644 |
| --- a/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp |
| +++ b/fpdfsdk/fpdfxfa/fpdfxfa_doc.cpp |
| @@ -656,7 +656,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)) { |
| @@ -699,13 +699,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 = |
|
Lei Zhang
2016/04/13 21:54:58
const char szFormat[] ?
Ditto for line 958.
Tom Sepez
2016/04/13 22:25:19
No, wouldn't that imply a copy into an local aggre
|
| "\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()); |
| } |
| @@ -955,8 +955,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) |