Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: xfa/fxfa/parser/xfa_document_datadescription_imp.cpp

Issue 2031873003: Get rid of NULLs in xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_fpdfsdk
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/parser/xfa_basic_imp.cpp ('k') | xfa/fxfa/parser/xfa_document_datamerger_imp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/parser/xfa_doclayout.h" 7 #include "xfa/fxfa/parser/xfa_doclayout.h"
8 #include "xfa/fxfa/parser/xfa_document.h" 8 #include "xfa/fxfa/parser/xfa_document.h"
9 #include "xfa/fxfa/parser/xfa_localemgr.h" 9 #include "xfa/fxfa/parser/xfa_localemgr.h"
10 #include "xfa/fxfa/parser/xfa_object.h" 10 #include "xfa/fxfa/parser/xfa_object.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 break; 61 break;
62 } 62 }
63 } 63 }
64 } 64 }
65 CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( 65 CXFA_Node* XFA_DataDescription_MaybeCreateDataNode(
66 CXFA_Document* pDocument, 66 CXFA_Document* pDocument,
67 CXFA_Node* pDataParent, 67 CXFA_Node* pDataParent,
68 XFA_ELEMENT eNodeType, 68 XFA_ELEMENT eNodeType,
69 const CFX_WideString& wsName) { 69 const CFX_WideString& wsName) {
70 if (!pDataParent) { 70 if (!pDataParent) {
71 return NULL; 71 return nullptr;
72 } 72 }
73 CXFA_Node* pParentDDNode = pDataParent->GetDataDescriptionNode(); 73 CXFA_Node* pParentDDNode = pDataParent->GetDataDescriptionNode();
74 if (!pParentDDNode) { 74 if (!pParentDDNode) {
75 CXFA_Node* pDataNode = 75 CXFA_Node* pDataNode =
76 pDocument->CreateNode(XFA_XDPPACKET_Datasets, eNodeType); 76 pDocument->CreateNode(XFA_XDPPACKET_Datasets, eNodeType);
77 ASSERT(pDataNode); 77 ASSERT(pDataNode);
78 pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName); 78 pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName);
79 pDataNode->CreateXMLMappingNode(); 79 pDataNode->CreateXMLMappingNode();
80 pDataParent->InsertChild(pDataNode); 80 pDataParent->InsertChild(pDataNode);
81 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, false); 81 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, false);
(...skipping 29 matching lines...) Expand all
111 if (eNodeType == XFA_ELEMENT_DataValue && 111 if (eNodeType == XFA_ELEMENT_DataValue &&
112 pDDNode->GetEnum(XFA_ATTRIBUTE_Contains) == 112 pDDNode->GetEnum(XFA_ATTRIBUTE_Contains) ==
113 XFA_ATTRIBUTEENUM_MetaData) { 113 XFA_ATTRIBUTEENUM_MetaData) {
114 pDataNode->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_MetaData); 114 pDataNode->SetEnum(XFA_ATTRIBUTE_Contains, XFA_ATTRIBUTEENUM_MetaData);
115 } 115 }
116 pDataParent->InsertChild(pDataNode); 116 pDataParent->InsertChild(pDataNode);
117 pDataNode->SetDataDescriptionNode(pDDNode); 117 pDataNode->SetDataDescriptionNode(pDDNode);
118 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, false); 118 pDataNode->SetFlag(XFA_NODEFLAG_Initialized, false);
119 return pDataNode; 119 return pDataNode;
120 } 120 }
121 return NULL; 121 return nullptr;
122 } 122 }
123 } 123 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_basic_imp.cpp ('k') | xfa/fxfa/parser/xfa_document_datamerger_imp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698