summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-04-18 11:54:04 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-04-18 17:53:07 +0000
commit5ae87922cb96810a05b2262c66b55b7e8f00e46d (patch)
tree4acc973ec8693b2a00222a06786aeebcbdfd3443 /xfa/fxfa/parser/cxfa_node.cpp
parenteccf405a479292144aa04dae4e02dae3edbba84e (diff)
downloadpdfium-5ae87922cb96810a05b2262c66b55b7e8f00e46d.tar.xz
Update IFGAS_Stream::WriteString to take a string.
This Cl updates the WriteString method to accept a CFX_WideString. Change-Id: I9f480abf32f4132f8ca33799e673a9e8540285f6 Reviewed-on: https://pdfium-review.googlesource.com/4151 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 5f582458de..d29df39e8e 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1397,14 +1397,15 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
}
bPrettyMode = true;
}
- CFX_ByteStringC bsXMLHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ CFX_WideString bsXMLHeader = L"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
if (GetPacketID() == XFA_XDPPACKET_Form ||
GetPacketID() == XFA_XDPPACKET_Datasets) {
CFDE_XMLNode* pElement = nullptr;
if (GetPacketID() == XFA_XDPPACKET_Datasets) {
pElement = GetXMLMappingNode();
if (!pElement || pElement->GetType() != FDE_XMLNODE_Element) {
- pArguments->GetReturnValue()->SetString(bsXMLHeader);
+ pArguments->GetReturnValue()->SetString(
+ bsXMLHeader.UTF8Encode().AsStringC());
return;
}
XFA_DataExporter_DealWithDataGroupNode(this);
@@ -1415,11 +1416,13 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
IFGAS_Stream::CreateWriteStream(pMemoryStream);
if (!pStream) {
- pArguments->GetReturnValue()->SetString(bsXMLHeader);
+ pArguments->GetReturnValue()->SetString(
+ bsXMLHeader.UTF8Encode().AsStringC());
return;
}
pStream->SetCodePage(FX_CODEPAGE_UTF8);
- pStream->WriteData(bsXMLHeader.raw_str(), bsXMLHeader.GetLength());
+ pStream->WriteString(bsXMLHeader.AsStringC());
+
if (GetPacketID() == XFA_XDPPACKET_Form)
XFA_DataExporter_RegenerateFormFile(this, pStream, nullptr, true);
else