From f6baf6b1d101a889d2cfc7cb925e726dbffb89db Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 12 Apr 2017 15:31:05 -0400 Subject: Fold CFGAS_Stream into CFGAS_TextStream. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every CFGAS_Stream is wrapped inside a CFGAS_TextStream. This CL folds the two classes together and merges the methods where needed. Change-Id: Ic56449b36baa51254d8d600ce631f285ba2cbb80 Reviewed-on: https://pdfium-review.googlesource.com/4057 Commit-Queue: dsinclair Reviewed-by: Nicolás Peña --- xfa/fde/cfde_txtedtengine.cpp | 3 +-- xfa/fde/xml/cfde_xmlsyntaxparser.cpp | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'xfa/fde') diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index 633e0bc68e..b6471766db 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -117,8 +117,7 @@ void CFDE_TxtEdtEngine::SetTextByStream( } bool bPreIsCR = false; if (bValid) { - uint8_t bom[4]; - int32_t nPos = pStream->GetBOM(bom); + int32_t nPos = pStream->GetBOMLength(); pStream->Seek(FX_STREAMSEEK_Begin, nPos); int32_t nPlateSize = std::min(nStreamLength, m_pTxtBuf->GetChunkSize()); wchar_t* lpwstr = FX_Alloc(wchar_t, nPlateSize); diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp index 57501cceca..51507526c2 100644 --- a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp +++ b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp @@ -106,9 +106,7 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser( m_CurNode.eNodeType = FDE_XMLNODE_Unknown; m_iXMLPlaneSize = std::min(m_iXMLPlaneSize, m_pStream->GetLength()); - - uint8_t bom[4]; - m_iCurrentPos = m_pStream->GetBOM(bom); + m_iCurrentPos = m_pStream->GetBOMLength(); FX_SAFE_INT32 alloc_size_safe = m_iXMLPlaneSize; alloc_size_safe += 1; // For NUL. -- cgit v1.2.3