From d7120eead6f6e0b05c1197e55e899081deae1289 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 11 Apr 2017 09:03:14 -0400 Subject: Disabiguate CreateStream calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL creates a CreateReadStream and CreateWriteStream method instead of having a single overloaded method. This removes the need for the cast at the call sites. The access parameter has been rolled into the method as it was always passed the same way to each Create*Stream method. Change-Id: I845951c3fe386b8051daf4f6b2ee5ba29b5c7d54 Reviewed-on: https://pdfium-review.googlesource.com/4032 Reviewed-by: Nicolás Peña Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_dataexporter.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_dataexporter.cpp') diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index fda29c2201..3963b162cb 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -226,12 +226,8 @@ void RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_RetainPtr pMemStream = IFX_MemoryStream::Create(true); - - // Note: ambiguous without cast below. - CFX_RetainPtr pTempStream = IFGAS_Stream::CreateStream( - CFX_RetainPtr(pMemStream), - FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | - FX_STREAMACCESS_Append); + CFX_RetainPtr pTempStream = + IFGAS_Stream::CreateWriteStream(pMemStream); pTempStream->SetCodePage(FX_CODEPAGE_UTF8); pRichTextXML->SaveXMLNode(pTempStream); @@ -489,9 +485,7 @@ bool CXFA_DataExporter::Export( if (!pWrite) return false; - CFX_RetainPtr pStream = IFGAS_Stream::CreateStream( - pWrite, - FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | FX_STREAMACCESS_Append); + CFX_RetainPtr pStream = IFGAS_Stream::CreateWriteStream(pWrite); if (!pStream) return false; -- cgit v1.2.3