diff options
author | dan sinclair <dsinclair@chromium.org> | 2018-04-13 00:22:55 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-13 00:22:55 +0000 |
commit | 7afdad5ab7a1bd54ddf6f2a823be30d4b8e39567 (patch) | |
tree | a594f1a42c742187d2312e0143f96548186ca33a /xfa/fxfa/parser/cxfa_document_parser.cpp | |
parent | c9f8d5af69e3b0bb6c8e58e74b61c016b2d099a1 (diff) | |
download | pdfium-7afdad5ab7a1bd54ddf6f2a823be30d4b8e39567.tar.xz |
Make CFX_XMLInstruction a subclass of CFX_XMLNode
The CFX_XMLInstruction handles the <?blah?> 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 <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document_parser.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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<WideString>& 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); |