diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-27 08:58:46 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-27 08:58:46 -0700 |
commit | 88e28aa259bc0f318cccf17eebabd3c887a15a46 (patch) | |
tree | c6c23feeaf12bc21359b53a16328fa9ffc36f0fa /xfa | |
parent | 24967515b8be77a79aa1599f8fbf5d3ecbcd1769 (diff) | |
download | pdfium-88e28aa259bc0f318cccf17eebabd3c887a15a46.tar.xz |
Revert accidental commits to XFA.
Revert "Add an embedded test case"
This reverts commit ec44186fdbca423eddf432be8b5c38914674023a.
Revert "Update the format"
This reverts commit 1df068061b5bb5e768a623318186523ffd251aaa.
Revert "Update .in file"
This reverts commit c13090439e1fbfd8a18c358058f137f897a7477b.
Revert "Address review comments"
This reverts commit 24967515b8be77a79aa1599f8fbf5d3ecbcd1769.
TBR=jun_fang@foxitsoftware.com
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1414033007 .
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/src/fxfa/src/parser/xfa_parser_imp.cpp | 39 | ||||
-rw-r--r-- | xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp | 15 |
2 files changed, 13 insertions, 41 deletions
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp index 48547d7e9f..9e85c1f539 100644 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp +++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp @@ -386,12 +386,12 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( pXMLDocumentNode, XFA_GetPacketByIndex(XFA_PACKET_XDP)->pName,
XFA_GetPacketByIndex(XFA_PACKET_XDP)->pURI,
XFA_GetPacketByIndex(XFA_PACKET_XDP)->eFlags)) {
- return nullptr;
+ return NULL;
}
CXFA_Node* pXFARootNode =
m_pFactory->CreateNode(XFA_XDPPACKET_XDP, XFA_ELEMENT_Xfa);
if (!pXFARootNode) {
- return nullptr;
+ return NULL;
}
m_pRootNode = pXFARootNode;
pXFARootNode->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"xfa"));
@@ -408,8 +408,8 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( }
}
}
- IFDE_XMLNode* pXMLConfigDOMRoot = nullptr;
- CXFA_Node* pXFAConfigDOMRoot = nullptr;
+ IFDE_XMLNode* pXMLConfigDOMRoot = NULL;
+ CXFA_Node* pXFAConfigDOMRoot = NULL;
{
for (IFDE_XMLNode* pChildItem =
pXMLDocumentNode->GetNodeItem(IFDE_XMLNode::FirstChild);
@@ -423,7 +423,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( }
if (CXFA_Node* pChildNode =
pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) {
- return nullptr;
+ return NULL;
}
pXMLConfigDOMRoot = pChildItem;
pXFAConfigDOMRoot =
@@ -431,9 +431,8 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( pXFARootNode->InsertChild(pXFAConfigDOMRoot, NULL);
}
}
- IFDE_XMLNode* pXMLDatasetsDOMRoot = nullptr;
- IFDE_XMLNode* pXMLFormDOMRoot = nullptr;
- IFDE_XMLNode* pXMLTemplateDOMRoot = nullptr;
+ IFDE_XMLNode* pXMLDatasetsDOMRoot = NULL;
+ IFDE_XMLNode* pXMLFormDOMRoot = NULL;
{
for (IFDE_XMLNode* pChildItem =
pXMLDocumentNode->GetNodeItem(IFDE_XMLNode::FirstChild);
@@ -454,7 +453,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( if (!XFA_FDEExtension_MatchNodeName(pElement, pPacketInfo->pName,
pPacketInfo->pURI,
pPacketInfo->eFlags)) {
- pPacketInfo = nullptr;
+ pPacketInfo = NULL;
}
}
XFA_XDPPACKET ePacket =
@@ -464,41 +463,29 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP( }
if (ePacket == XFA_XDPPACKET_Datasets) {
if (pXMLDatasetsDOMRoot) {
- return nullptr;
+ pXMLDatasetsDOMRoot = NULL;
+ return NULL;
}
pXMLDatasetsDOMRoot = pElement;
} else if (ePacket == XFA_XDPPACKET_Form) {
if (pXMLFormDOMRoot) {
- return nullptr;
+ pXMLFormDOMRoot = NULL;
+ return NULL;
}
pXMLFormDOMRoot = pElement;
- } else if (ePacket == XFA_XDPPACKET_Template) {
- if (pXMLTemplateDOMRoot) {
- // Found a duplicate template packet.
- return nullptr;
- }
- CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);
- if (pPacketNode) {
- pXMLTemplateDOMRoot = pElement;
- pXFARootNode->InsertChild(pPacketNode);
- }
} else {
CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);
if (pPacketNode) {
if (pPacketInfo &&
(pPacketInfo->eFlags & XFA_XDPPACKET_FLAGS_SUPPORTONE) &&
pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) {
- return nullptr;
+ return NULL;
}
pXFARootNode->InsertChild(pPacketNode);
}
}
}
}
- if (!pXMLTemplateDOMRoot) {
- // No template is found.
- return nullptr;
- }
if (pXMLDatasetsDOMRoot) {
CXFA_Node* pPacketNode =
ParseAsXDPPacket(pXMLDatasetsDOMRoot, XFA_XDPPACKET_Datasets);
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp deleted file mode 100644 index 5a3059c0f5..0000000000 --- a/xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2015 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "../../../../../testing/embedder_test.h" -#include "testing/gtest/include/gtest/gtest.h" - -class XFAParserImpEmbeddertest : public EmbedderTest {}; - -TEST_F(XFAParserImpEmbeddertest, Bug_216) { - EXPECT_TRUE(OpenDocument("testing/resources/bug_216.pdf")); - FPDF_PAGE page = LoadPage(0); - EXPECT_NE(nullptr, page); - UnloadPage(page); -}
\ No newline at end of file |