From 7023b8877475dda639a15d623b5a552f88a6812f Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 12 Apr 2018 13:54:39 +0000 Subject: Remove CXFA_DocumentParser::m_bDocumentParser flag This CL removes the import data behaviour as it was never called and cleans up the m_bDocumentParser flag as it will always be used in the true case. Change-Id: If90a0a55cc76f406e9987aa71580e90edeaa01ba Reviewed-on: https://pdfium-review.googlesource.com/30292 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_document_parser.cpp | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_document_parser.cpp') diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index c2cc1deb88..97f34b6472 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -322,18 +322,11 @@ bool XFA_RecognizeRichText(CFX_XMLElement* pRichTextXMLNode) { L"http://www.w3.org/1999/xhtml"; } -CXFA_DocumentParser::CXFA_DocumentParser() : m_bDocumentParser(true) {} - CXFA_DocumentParser::CXFA_DocumentParser(CXFA_Document* pFactory) - : m_pFactory(pFactory), m_bDocumentParser(false) {} + : m_pFactory(pFactory) {} CXFA_DocumentParser::~CXFA_DocumentParser() {} -void CXFA_DocumentParser::SetFactory(CXFA_Document* pFactory) { - ASSERT(m_bDocumentParser); - m_pFactory = pFactory; -} - bool CXFA_DocumentParser::Parse(const RetainPtr& pStream, XFA_PacketType ePacketID) { auto pStreamProxy = @@ -604,15 +597,15 @@ CXFA_Node* CXFA_DocumentParser::ParseAsXDPPacket_Template( return nullptr; pNode->JSObject()->SetCData(XFA_Attribute::Name, packet->name, false, false); - if (m_bDocumentParser) { - CFX_XMLElement* pXMLDocumentElement = - static_cast(pXMLDocumentNode); - WideString wsNamespaceURI = pXMLDocumentElement->GetNamespaceURI(); - if (wsNamespaceURI.IsEmpty()) - wsNamespaceURI = pXMLDocumentElement->GetString(L"xmlns:xfa"); - - pNode->GetDocument()->RecognizeXFAVersionNumber(wsNamespaceURI); - } + + CFX_XMLElement* pXMLDocumentElement = + static_cast(pXMLDocumentNode); + WideString wsNamespaceURI = pXMLDocumentElement->GetNamespaceURI(); + if (wsNamespaceURI.IsEmpty()) + wsNamespaceURI = pXMLDocumentElement->GetString(L"xmlns:xfa"); + + pNode->GetDocument()->RecognizeXFAVersionNumber(wsNamespaceURI); + if (!NormalLoader(pNode, pXMLDocumentNode, XFA_PacketType::Template, true)) return nullptr; @@ -1148,9 +1141,6 @@ void CXFA_DocumentParser::ParseDataValue(CXFA_Node* pXFANode, void CXFA_DocumentParser::ParseInstruction(CXFA_Node* pXFANode, CFX_XMLInstruction* pXMLInstruction, XFA_PacketType ePacketID) { - if (!m_bDocumentParser) - return; - WideString wsTargetName = pXMLInstruction->GetName(); const std::vector& target_data = pXMLInstruction->GetTargetData(); if (wsTargetName == L"originalXFAVersion") { -- cgit v1.2.3