Address review comments
authorJun Fang <jun_fang@foxitsoftware.com>
Tue, 27 Oct 2015 03:38:33 +0000 (11:38 +0800)
committerJun Fang <jun_fang@foxitsoftware.com>
Tue, 27 Oct 2015 03:38:33 +0000 (11:38 +0800)
xfa/src/fxfa/src/parser/xfa_parser_imp.cpp

index e782f06..48547d7 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 NULL;\r
+    return nullptr;\r
   }\r
   CXFA_Node* pXFARootNode =\r
       m_pFactory->CreateNode(XFA_XDPPACKET_XDP, XFA_ELEMENT_Xfa);\r
   if (!pXFARootNode) {\r
-    return NULL;\r
+    return nullptr;\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 = NULL;\r
-  CXFA_Node* pXFAConfigDOMRoot = NULL;\r
+  IFDE_XMLNode* pXMLConfigDOMRoot = nullptr;\r
+  CXFA_Node* pXFAConfigDOMRoot = nullptr;\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 NULL;\r
+        return nullptr;\r
       }\r
       pXMLConfigDOMRoot = pChildItem;\r
       pXFAConfigDOMRoot =\r
@@ -431,9 +431,9 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
       pXFARootNode->InsertChild(pXFAConfigDOMRoot, NULL);\r
     }\r
   }\r
-  IFDE_XMLNode* pXMLDatasetsDOMRoot = NULL;\r
-  IFDE_XMLNode* pXMLFormDOMRoot = NULL;\r
-  IFDE_XMLNode* pXMLTemplateDOMRoot = NULL;\r
+  IFDE_XMLNode* pXMLDatasetsDOMRoot = nullptr;\r
+  IFDE_XMLNode* pXMLFormDOMRoot = nullptr;\r
+  IFDE_XMLNode* pXMLTemplateDOMRoot = nullptr;\r
   {\r
     for (IFDE_XMLNode* pChildItem =\r
              pXMLDocumentNode->GetNodeItem(IFDE_XMLNode::FirstChild);\r
@@ -454,7 +454,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
         if (!XFA_FDEExtension_MatchNodeName(pElement, pPacketInfo->pName,\r
                                             pPacketInfo->pURI,\r
                                             pPacketInfo->eFlags)) {\r
-          pPacketInfo = NULL;\r
+          pPacketInfo = nullptr;\r
         }\r
       }\r
       XFA_XDPPACKET ePacket =\r
@@ -464,20 +464,18 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
       }\r
       if (ePacket == XFA_XDPPACKET_Datasets) {\r
         if (pXMLDatasetsDOMRoot) {\r
-          pXMLDatasetsDOMRoot = NULL;\r
-          return NULL;\r
+          return nullptr;\r
         }\r
         pXMLDatasetsDOMRoot = pElement;\r
       } else if (ePacket == XFA_XDPPACKET_Form) {\r
         if (pXMLFormDOMRoot) {\r
-          pXMLFormDOMRoot = NULL;\r
-          return NULL;\r
+          return nullptr;\r
         }\r
         pXMLFormDOMRoot = pElement;\r
       } else if (ePacket == XFA_XDPPACKET_Template) {\r
         if (pXMLTemplateDOMRoot) {\r
-          // Find a duplicate template packet\r
-          return NULL;\r
+          // Found a duplicate template packet.\r
+          return nullptr;\r
         }\r
         CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);\r
         if (pPacketNode) {\r
@@ -490,7 +488,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
           if (pPacketInfo &&\r
               (pPacketInfo->eFlags & XFA_XDPPACKET_FLAGS_SUPPORTONE) &&\r
               pXFARootNode->GetFirstChildByName(pPacketInfo->uHash)) {\r
-            return NULL;\r
+            return nullptr;\r
           }\r
           pXFARootNode->InsertChild(pPacketNode);\r
         }\r
@@ -499,7 +497,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
   }\r
   if (!pXMLTemplateDOMRoot) {\r
     // No template is found.\r
-    return NULL;\r
+    return nullptr;\r
   }\r
   if (pXMLDatasetsDOMRoot) {\r
     CXFA_Node* pPacketNode =\r