From ba367068887aca9f700289aa1b8c198920ca39a2 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 1 May 2018 17:02:54 +0000 Subject: Fixes XML Instruction handling in CXFA_DocumentParser. This CL fixes issues with handling XML instructions in CXFA_DocumentParser. Unittests were added to verify the behaviour. Change-Id: Iff8d51d0e6d411419473c9b2c32c700d4bbf86f5 Reviewed-on: https://pdfium-review.googlesource.com/31810 Commit-Queue: dsinclair Reviewed-by: Ryan Harrison Reviewed-by: Henrique Nakashima --- xfa/fxfa/parser/cxfa_document_parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 f773a36897..fe246d2300 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -325,7 +325,7 @@ bool XFA_RecognizeRichText(CFX_XMLElement* pRichTextXMLNode) { CXFA_DocumentParser::CXFA_DocumentParser(CXFA_Document* pFactory) : m_pFactory(pFactory) {} -CXFA_DocumentParser::~CXFA_DocumentParser() {} +CXFA_DocumentParser::~CXFA_DocumentParser() = default; bool CXFA_DocumentParser::Parse(const RetainPtr& pStream, XFA_PacketType ePacketID) { @@ -1137,6 +1137,7 @@ void CXFA_DocumentParser::ParseInstruction(CXFA_Node* pXFANode, CFX_XMLInstruction* pXMLInstruction, XFA_PacketType ePacketID) { const std::vector& target_data = pXMLInstruction->GetTargetData(); + if (pXMLInstruction->IsOriginalXFAVersion()) { if (target_data.size() > 1 && (pXFANode->GetDocument()->RecognizeXFAVersionNumber(target_data[0]) != -- cgit v1.2.3