From 0d86ecb08e1b2c204333b1f1f6b0b014e5b2971c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 19 Apr 2017 09:19:57 -0400 Subject: Move fde XML parser to core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL moves the XML parser from FDE into FXCRT and renames to CFX_ from CFDE_. Change-Id: I21a9590bf74daf5517df630d7e7a5de89da99ea4 Reviewed-on: https://pdfium-review.googlesource.com/4312 Commit-Queue: dsinclair Reviewed-by: Tom Sepez Reviewed-by: Nicolás Peña --- xfa/fxfa/cxfa_ffdoc.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'xfa/fxfa/cxfa_ffdoc.cpp') diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp index 3565370bde..04741f9082 100644 --- a/xfa/fxfa/cxfa_ffdoc.cpp +++ b/xfa/fxfa/cxfa_ffdoc.cpp @@ -17,9 +17,9 @@ #include "core/fxcrt/cfx_checksumcontext.h" #include "core/fxcrt/fx_ext.h" #include "core/fxcrt/fx_memory.h" +#include "core/fxcrt/xml/cfx_xmlelement.h" +#include "core/fxcrt/xml/cfx_xmlnode.h" #include "third_party/base/ptr_util.h" -#include "xfa/fde/xml/cfde_xmlelement.h" -#include "xfa/fde/xml/cfde_xmlnode.h" #include "xfa/fwl/cfwl_notedriver.h" #include "xfa/fxfa/app/xfa_ffnotify.h" #include "xfa/fxfa/cxfa_ffapp.h" @@ -171,15 +171,15 @@ int32_t CXFA_FFDoc::StartLoad() { return m_pDocumentParser->StartParse(m_pStream, XFA_XDPPACKET_XDP); } -bool XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement, +bool XFA_GetPDFContentsFromPDFXML(CFX_XMLNode* pPDFElement, uint8_t*& pByteBuffer, int32_t& iBufferSize) { - CFDE_XMLElement* pDocumentElement = nullptr; - for (CFDE_XMLNode* pXMLNode = - pPDFElement->GetNodeItem(CFDE_XMLNode::FirstChild); - pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling)) { - if (pXMLNode->GetType() == FDE_XMLNODE_Element) { - CFDE_XMLElement* pXMLElement = static_cast(pXMLNode); + CFX_XMLElement* pDocumentElement = nullptr; + for (CFX_XMLNode* pXMLNode = + pPDFElement->GetNodeItem(CFX_XMLNode::FirstChild); + pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFX_XMLNode::NextSibling)) { + if (pXMLNode->GetType() == FX_XMLNODE_Element) { + CFX_XMLElement* pXMLElement = static_cast(pXMLNode); CFX_WideString wsTagName = pXMLElement->GetName(); if (wsTagName == L"document") { pDocumentElement = pXMLElement; @@ -190,12 +190,12 @@ bool XFA_GetPDFContentsFromPDFXML(CFDE_XMLNode* pPDFElement, if (!pDocumentElement) { return false; } - CFDE_XMLElement* pChunkElement = nullptr; - for (CFDE_XMLNode* pXMLNode = - pDocumentElement->GetNodeItem(CFDE_XMLNode::FirstChild); - pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFDE_XMLNode::NextSibling)) { - if (pXMLNode->GetType() == FDE_XMLNODE_Element) { - CFDE_XMLElement* pXMLElement = static_cast(pXMLNode); + CFX_XMLElement* pChunkElement = nullptr; + for (CFX_XMLNode* pXMLNode = + pDocumentElement->GetNodeItem(CFX_XMLNode::FirstChild); + pXMLNode; pXMLNode = pXMLNode->GetNodeItem(CFX_XMLNode::NextSibling)) { + if (pXMLNode->GetType() == FX_XMLNODE_Element) { + CFX_XMLElement* pXMLElement = static_cast(pXMLNode); CFX_WideString wsTagName = pXMLElement->GetName(); if (wsTagName == L"chunk") { pChunkElement = pXMLElement; -- cgit v1.2.3