Revert accidental commits to XFA.
authorTom Sepez <tsepez@chromium.org>
Tue, 27 Oct 2015 15:58:46 +0000 (08:58 -0700)
committerTom Sepez <tsepez@chromium.org>
Tue, 27 Oct 2015 15:58:46 +0000 (08:58 -0700)
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 .

BUILD.gn
pdfium.gyp
testing/resources/bug_216.in [deleted file]
testing/resources/bug_216.pdf [deleted file]
xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp [deleted file]

index 8f8b903..5657296 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1511,7 +1511,6 @@ test("pdfium_embeddertests") {
     "testing/embedder_test.h",
     "testing/embedder_test_mock_delegate.h",
     "testing/embedder_test_timer_handling_delegate.h",
-    "xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp",
   ]
   deps = [
     "//testing/gmock",
index 22d6304..b101096 100644 (file)
         'testing/embedder_test.h',
         'testing/embedder_test_mock_delegate.h',
         'testing/embedder_test_timer_handling_delegate.h',
-        'xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp',
       ],
       'conditions': [
         ['pdf_enable_v8==1', {
diff --git a/testing/resources/bug_216.in b/testing/resources/bug_216.in
deleted file mode 100644 (file)
index 1ecd862..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-{{header}}
-{{object 1 0}} <<
-  /Type /Catalog
-  /Pages 2 0 R
-  /AcroForm 4 0 R
->>
-endobj
-{{object 2 0}} <<
-  /Type /Pages
-  /Count 1
->>
-endobj
-{{object 4 0}} <<
-  /XFA [
-    (xdp:xdp) 23 0 R
-    (form) 29 0 R
-    (</xdp:xdp>) 30 0 R]
->>
-endobj
-{{object 23 0}} <<
->>stream
-<?xml version="1.0" encoding="UTF-8"?>
-<xdp:xdp xmlns:xdp="http://www.foxitsoftware.com/">
-endstream
-endobj
-{{object 29 0}} <<
->>stream
-<form xmlns="http://www.xfa.org/schema/xfa-form/2.6/">
-</form>
-endstream
-endobj
-{{object 30 0}} <<
->>stream
-</xdp:xdp>
-endstream
-endobj
-trailer
-<</Root 1 0 R>>
-%%EOF
diff --git a/testing/resources/bug_216.pdf b/testing/resources/bug_216.pdf
deleted file mode 100644 (file)
index 2d59872..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-%PDF-1.7
-% ò¤ô
-1 0 obj <<
-  /Type /Catalog
-  /Pages 2 0 R
-  /AcroForm 4 0 R
->>
-endobj
-2 0 obj <<
-  /Type /Pages
-  /Count 1
->>
-endobj
-4 0 obj <<
-  /XFA [
-    (xdp:xdp) 23 0 R
-    (form) 29 0 R
-    (</xdp:xdp>) 30 0 R]
->>
-endobj
-23 0 obj <<
->>stream
-<?xml version="1.0" encoding="UTF-8"?>
-<xdp:xdp xmlns:xdp="http://www.foxitsoftware.com/">
-endstream
-endobj
-29 0 obj <<
->>stream
-<form xmlns="http://www.xfa.org/schema/xfa-form/2.6/">
-</form>
-endstream
-endobj
-30 0 obj <<
->>stream
-</xdp:xdp>
-endstream
-endobj
-trailer
-<</Root 1 0 R>>
-%%EOF
index 48547d7..9e85c1f 100644 (file)
@@ -386,12 +386,12 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
           pXMLDocumentNode, XFA_GetPacketByIndex(XFA_PACKET_XDP)->pName,\r
           XFA_GetPacketByIndex(XFA_PACKET_XDP)->pURI,\r
           XFA_GetPacketByIndex(XFA_PACKET_XDP)->eFlags)) {\r
-    return nullptr;\r
+    return NULL;\r
   }\r
   CXFA_Node* pXFARootNode =\r
       m_pFactory->CreateNode(XFA_XDPPACKET_XDP, XFA_ELEMENT_Xfa);\r
   if (!pXFARootNode) {\r
-    return nullptr;\r
+    return NULL;\r
   }\r
   m_pRootNode = pXFARootNode;\r
   pXFARootNode->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"xfa"));\r
@@ -408,8 +408,8 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
       }\r
     }\r
   }\r
-  IFDE_XMLNode* pXMLConfigDOMRoot = nullptr;\r
-  CXFA_Node* pXFAConfigDOMRoot = nullptr;\r
+  IFDE_XMLNode* pXMLConfigDOMRoot = NULL;\r
+  CXFA_Node* pXFAConfigDOMRoot = NULL;\r
   {\r
     for (IFDE_XMLNode* pChildItem =\r
              pXMLDocumentNode->GetNodeItem(IFDE_XMLNode::FirstChild);\r
@@ -423,7 +423,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
       }\r
       if (CXFA_Node* pChildNode =\r
               pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) {\r
-        return nullptr;\r
+        return NULL;\r
       }\r
       pXMLConfigDOMRoot = pChildItem;\r
       pXFAConfigDOMRoot =\r
@@ -431,9 +431,8 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
       pXFARootNode->InsertChild(pXFAConfigDOMRoot, NULL);\r
     }\r
   }\r
-  IFDE_XMLNode* pXMLDatasetsDOMRoot = nullptr;\r
-  IFDE_XMLNode* pXMLFormDOMRoot = nullptr;\r
-  IFDE_XMLNode* pXMLTemplateDOMRoot = nullptr;\r
+  IFDE_XMLNode* pXMLDatasetsDOMRoot = NULL;\r
+  IFDE_XMLNode* pXMLFormDOMRoot = NULL;\r
   {\r
     for (IFDE_XMLNode* pChildItem =\r
              pXMLDocumentNode->GetNodeItem(IFDE_XMLNode::FirstChild);\r
@@ -454,7 +453,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
         if (!XFA_FDEExtension_MatchNodeName(pElement, pPacketInfo->pName,\r
                                             pPacketInfo->pURI,\r
                                             pPacketInfo->eFlags)) {\r
-          pPacketInfo = nullptr;\r
+          pPacketInfo = NULL;\r
         }\r
       }\r
       XFA_XDPPACKET ePacket =\r
@@ -464,41 +463,29 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
       }\r
       if (ePacket == XFA_XDPPACKET_Datasets) {\r
         if (pXMLDatasetsDOMRoot) {\r
-          return nullptr;\r
+          pXMLDatasetsDOMRoot = NULL;\r
+          return NULL;\r
         }\r
         pXMLDatasetsDOMRoot = pElement;\r
       } else if (ePacket == XFA_XDPPACKET_Form) {\r
         if (pXMLFormDOMRoot) {\r
-          return nullptr;\r
+          pXMLFormDOMRoot = NULL;\r
+          return NULL;\r
         }\r
         pXMLFormDOMRoot = pElement;\r
-      } else if (ePacket == XFA_XDPPACKET_Template) {\r
-        if (pXMLTemplateDOMRoot) {\r
-          // Found a duplicate template packet.\r
-          return nullptr;\r
-        }\r
-        CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);\r
-        if (pPacketNode) {\r
-          pXMLTemplateDOMRoot = pElement;\r
-          pXFARootNode->InsertChild(pPacketNode);\r
-        }\r
       } else {\r
         CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);\r
         if (pPacketNode) {\r
           if (pPacketInfo &&\r
               (pPacketInfo->eFlags & XFA_XDPPACKET_FLAGS_SUPPORTONE) &&\r
               pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) {\r
-            return nullptr;\r
+            return NULL;\r
           }\r
           pXFARootNode->InsertChild(pPacketNode);\r
         }\r
       }\r
     }\r
   }\r
-  if (!pXMLTemplateDOMRoot) {\r
-    // No template is found.\r
-    return nullptr;\r
-  }\r
   if (pXMLDatasetsDOMRoot) {\r
     CXFA_Node* pPacketNode =\r
         ParseAsXDPPacket(pXMLDatasetsDOMRoot, XFA_XDPPACKET_Datasets);\r
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 (file)
index 5a3059c..0000000
+++ /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