summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_document_parser.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-04-12 13:54:39 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-12 13:54:39 +0000
commit7023b8877475dda639a15d623b5a552f88a6812f (patch)
tree419e9359df5e36941e61ee18b3a470666253d379 /xfa/fxfa/parser/cxfa_document_parser.cpp
parentbabeeb69b1744e414b46d77de03689682742d99d (diff)
downloadpdfium-7023b8877475dda639a15d623b5a552f88a6812f.tar.xz
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 <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document_parser.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_document_parser.cpp30
1 files changed, 10 insertions, 20 deletions
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<IFX_SeekableStream>& 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<CFX_XMLElement*>(pXMLDocumentNode);
- WideString wsNamespaceURI = pXMLDocumentElement->GetNamespaceURI();
- if (wsNamespaceURI.IsEmpty())
- wsNamespaceURI = pXMLDocumentElement->GetString(L"xmlns:xfa");
-
- pNode->GetDocument()->RecognizeXFAVersionNumber(wsNamespaceURI);
- }
+
+ CFX_XMLElement* pXMLDocumentElement =
+ static_cast<CFX_XMLElement*>(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<WideString>& target_data = pXMLInstruction->GetTargetData();
if (wsTargetName == L"originalXFAVersion") {