From 7afdad5ab7a1bd54ddf6f2a823be30d4b8e39567 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Fri, 13 Apr 2018 00:22:55 +0000 Subject: Make CFX_XMLInstruction a subclass of CFX_XMLNode The CFX_XMLInstruction handles the blocks at the top of an XML file. It was inheriting from CFX_XMLAttributeNode in order to store the tag name. This CL moves the tag name into CFX_XMLInstruction and subclasses from CFX_XMLNode. Change-Id: I8f7ff0dde19ed43b46d095b0d45df4bf06875af5 Reviewed-on: https://pdfium-review.googlesource.com/30490 Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima --- xfa/fxfa/parser/cxfa_document_parser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xfa') diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index 97f34b6472..98ac38065d 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -1141,16 +1141,18 @@ void CXFA_DocumentParser::ParseDataValue(CXFA_Node* pXFANode, void CXFA_DocumentParser::ParseInstruction(CXFA_Node* pXFANode, CFX_XMLInstruction* pXMLInstruction, XFA_PacketType ePacketID) { - WideString wsTargetName = pXMLInstruction->GetName(); const std::vector& target_data = pXMLInstruction->GetTargetData(); - if (wsTargetName == L"originalXFAVersion") { + if (pXMLInstruction->IsOriginalXFAVersion()) { if (target_data.size() > 1 && (pXFANode->GetDocument()->RecognizeXFAVersionNumber(target_data[0]) != XFA_VERSION_UNKNOWN) && target_data[1] == L"v2.7-scripting:1") { pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_Scripting, true); } - } else if (wsTargetName == L"acrobat") { + return; + } + + if (pXMLInstruction->IsAcrobat()) { if (target_data.size() > 1 && target_data[0] == L"JavaScript" && target_data[1] == L"strictScoping") { pXFANode->GetDocument()->SetFlag(XFA_DOCFLAG_StrictScoping, true); -- cgit v1.2.3