summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_node.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-07 12:10:20 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 12:10:20 -0800
commit7cda31ac2f2884166f044937619478a6103198cf (patch)
tree640f14ab5c81696cfffdedf0644eac4b1f2bc47f /xfa/fxfa/parser/cxfa_node.cpp
parentab5a20d9de8c801b8376bfe2d6f7cf9ac7d26028 (diff)
downloadpdfium-7cda31ac2f2884166f044937619478a6103198cf.tar.xz
Refcount IFGAS_ streams all the time, too
IFGAS_Streams are not part of the IFX_Stream hierarchy, but can be made from such. Review-Url: https://codereview.chromium.org/2559763002
Diffstat (limited to 'xfa/fxfa/parser/cxfa_node.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 5dd6c52717..f3f79cbbec 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1445,11 +1445,9 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
IFX_MemoryStream::Create(true);
// Note: ambiguious below without static_cast.
- std::unique_ptr<IFGAS_Stream, ReleaseDeleter<IFGAS_Stream>> pStream(
- IFGAS_Stream::CreateStream(
- CFX_RetainPtr<IFX_SeekableWriteStream>(pMemoryStream),
- FX_STREAMACCESS_Text | FX_STREAMACCESS_Write |
- FX_STREAMACCESS_Append));
+ CFX_RetainPtr<IFGAS_Stream> pStream = IFGAS_Stream::CreateStream(
+ CFX_RetainPtr<IFX_SeekableWriteStream>(pMemoryStream),
+ FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | FX_STREAMACCESS_Append);
if (!pStream) {
pArguments->GetReturnValue()->SetString(bsXMLHeader);
@@ -1458,9 +1456,9 @@ void CXFA_Node::Script_NodeClass_SaveXML(CFXJSE_Arguments* pArguments) {
pStream->SetCodePage(FX_CODEPAGE_UTF8);
pStream->WriteData(bsXMLHeader.raw_str(), bsXMLHeader.GetLength());
if (GetPacketID() == XFA_XDPPACKET_Form)
- XFA_DataExporter_RegenerateFormFile(this, pStream.get(), nullptr, true);
+ XFA_DataExporter_RegenerateFormFile(this, pStream, nullptr, true);
else
- pElement->SaveXMLNode(pStream.get());
+ pElement->SaveXMLNode(pStream);
// TODO(weili): Check whether we need to save pretty print XML, pdfium:501.
// For now, just put it here to avoid unused variable warning.
(void)bPrettyMode;