| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 7 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
| 8 #include "xfa/fxfa/parser/xfa_docdata.h" | 8 #include "xfa/fxfa/parser/xfa_docdata.h" |
| 9 #include "xfa/fxfa/parser/xfa_doclayout.h" | 9 #include "xfa/fxfa/parser/xfa_doclayout.h" |
| 10 #include "xfa/fxfa/parser/xfa_document.h" | 10 #include "xfa/fxfa/parser/xfa_document.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 return NULL; | 75 return NULL; |
| 76 } | 76 } |
| 77 CXFA_Node* pParentDDNode = pDataParent->GetDataDescriptionNode(); | 77 CXFA_Node* pParentDDNode = pDataParent->GetDataDescriptionNode(); |
| 78 if (!pParentDDNode) { | 78 if (!pParentDDNode) { |
| 79 CXFA_Node* pDataNode = | 79 CXFA_Node* pDataNode = |
| 80 pDocument->CreateNode(XFA_XDPPACKET_Datasets, eNodeType); | 80 pDocument->CreateNode(XFA_XDPPACKET_Datasets, eNodeType); |
| 81 FXSYS_assert(pDataNode); | 81 FXSYS_assert(pDataNode); |
| 82 pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName); | 82 pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName); |
| 83 pDataNode->CreateXMLMappingNode(); | 83 pDataNode->CreateXMLMappingNode(); |
| 84 pDataParent->InsertChild(pDataNode); | 84 pDataParent->InsertChild(pDataNode); |
| 85 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); | 85 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, false); |
| 86 return pDataNode; | 86 return pDataNode; |
| 87 } else { | 87 } else { |
| 88 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_DDGroup> | 88 CXFA_NodeIteratorTemplate<CXFA_Node, CXFA_TraverseStrategy_DDGroup> |
| 89 sIterator(pParentDDNode); | 89 sIterator(pParentDDNode); |
| 90 for (CXFA_Node* pDDGroupNode = sIterator.GetCurrent(); pDDGroupNode; | 90 for (CXFA_Node* pDDGroupNode = sIterator.GetCurrent(); pDDGroupNode; |
| 91 pDDGroupNode = sIterator.MoveToNext()) { | 91 pDDGroupNode = sIterator.MoveToNext()) { |
| 92 if (pDDGroupNode != pParentDDNode) { | 92 if (pDDGroupNode != pParentDDNode) { |
| 93 if (pDDGroupNode->GetClassID() != XFA_ELEMENT_DataGroup) { | 93 if (pDDGroupNode->GetClassID() != XFA_ELEMENT_DataGroup) { |
| 94 continue; | 94 continue; |
| 95 } | 95 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 111 FXSYS_assert(pDataNode); | 111 FXSYS_assert(pDataNode); |
| 112 pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName); | 112 pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName); |
| 113 pDataNode->CreateXMLMappingNode(); | 113 pDataNode->CreateXMLMappingNode(); |
| 114 if (eNodeType == XFA_ELEMENT_DataValue && | 114 if (eNodeType == XFA_ELEMENT_DataValue && |
| 115 pDDNode->GetEnum(XFA_ATTRIBUTE_Contains) == | 115 pDDNode->GetEnum(XFA_ATTRIBUTE_Contains) == |
| 116 XFA_ATTRIBUTEENUM_MetaData) { | 116 XFA_ATTRIBUTEENUM_MetaData) { |
| 117 pDataNode->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_MetaData); | 117 pDataNode->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_MetaData); |
| 118 } | 118 } |
| 119 pDataParent->InsertChild(pDataNode); | 119 pDataParent->InsertChild(pDataNode); |
| 120 pDataNode->SetDataDescriptionNode(pDDNode); | 120 pDataNode->SetDataDescriptionNode(pDDNode); |
| 121 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, TRUE, FALSE); | 121 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, false); |
| 122 return pDataNode; | 122 return pDataNode; |
| 123 } | 123 } |
| 124 return NULL; | 124 return NULL; |
| 125 } | 125 } |
| 126 } | 126 } |
| OLD | NEW |