summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_document_imp.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-23 12:40:16 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-23 12:40:16 -0700
commit85d1f2c2f9f1e746bedb1b6f03576613f54fbc27 (patch)
treeff5b393fb9b89f006327bee7bc8c955522defb67 /xfa/fxfa/parser/xfa_document_imp.cpp
parent6e12478cb298c3a8277493ee79ae0b73d6df8554 (diff)
downloadpdfium-85d1f2c2f9f1e746bedb1b6f03576613f54fbc27.tar.xz
Remove NULL in xfa/
This CL converts all NULL's to nullptr. All instances of comparison to nullptr have been removed. Review-Url: https://codereview.chromium.org/2095653002
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_document_imp.cpp35
1 files changed, 15 insertions, 20 deletions
diff --git a/xfa/fxfa/parser/xfa_document_imp.cpp b/xfa/fxfa/parser/xfa_document_imp.cpp
index 45102c8fb6..bcc37d9f65 100644
--- a/xfa/fxfa/parser/xfa_document_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_imp.cpp
@@ -83,7 +83,7 @@ CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) {
case XFA_HASHCODE_Data: {
CXFA_Node* pDatasetsNode = ToNode(GetXFAObject(XFA_HASHCODE_Datasets));
if (!pDatasetsNode) {
- return NULL;
+ return nullptr;
}
for (CXFA_Node* pDatasetsChild =
pDatasetsNode->GetFirstChildByClass(XFA_Element::DataGroup);
@@ -105,46 +105,41 @@ CXFA_Object* CXFA_Document::GetXFAObject(XFA_HashCode dwNodeNameHash) {
return pDatasetsChild;
}
}
+ return nullptr;
}
- return NULL;
case XFA_HASHCODE_Record: {
CXFA_Node* pData = ToNode(GetXFAObject(XFA_HASHCODE_Data));
- return pData ? pData->GetFirstChildByClass(XFA_Element::DataGroup) : NULL;
+ return pData ? pData->GetFirstChildByClass(XFA_Element::DataGroup)
+ : nullptr;
}
case XFA_HASHCODE_DataWindow: {
- if (m_pScriptDataWindow == NULL) {
+ if (!m_pScriptDataWindow)
m_pScriptDataWindow = new CScript_DataWindow(this);
- }
return m_pScriptDataWindow;
}
case XFA_HASHCODE_Event: {
- if (m_pScriptEvent == NULL) {
+ if (!m_pScriptEvent)
m_pScriptEvent = new CScript_EventPseudoModel(this);
- }
return m_pScriptEvent;
}
case XFA_HASHCODE_Host: {
- if (m_pScriptHost == NULL) {
+ if (!m_pScriptHost)
m_pScriptHost = new CScript_HostPseudoModel(this);
- }
return m_pScriptHost;
}
case XFA_HASHCODE_Log: {
- if (m_pScriptLog == NULL) {
+ if (!m_pScriptLog)
m_pScriptLog = new CScript_LogPseudoModel(this);
- }
return m_pScriptLog;
}
case XFA_HASHCODE_Signature: {
- if (m_pScriptSignature == NULL) {
+ if (!m_pScriptSignature)
m_pScriptSignature = new CScript_SignaturePseudoModel(this);
- }
return m_pScriptSignature;
}
case XFA_HASHCODE_Layout: {
- if (m_pScriptLayout == NULL) {
+ if (!m_pScriptLayout)
m_pScriptLayout = new CScript_LayoutPseudoModel(this);
- }
return m_pScriptLayout;
}
default:
@@ -268,7 +263,7 @@ XFA_VERSION CXFA_Document::RecognizeXFAVersionNumber(
CXFA_Node* CXFA_Document::GetNodeByID(CXFA_Node* pRoot,
const CFX_WideStringC& wsID) {
if (!pRoot || wsID.IsEmpty()) {
- return NULL;
+ return nullptr;
}
CXFA_NodeIterator sIterator(pRoot);
for (CXFA_Node* pNode = sIterator.GetCurrent(); pNode;
@@ -280,12 +275,12 @@ CXFA_Node* CXFA_Document::GetNodeByID(CXFA_Node* pRoot,
}
}
}
- return NULL;
+ return nullptr;
}
static void XFA_ProtoMerge_MergeNodeRecurse(CXFA_Document* pDocument,
CXFA_Node* pDestNodeParent,
CXFA_Node* pProtoNode) {
- CXFA_Node* pExistingNode = NULL;
+ CXFA_Node* pExistingNode = nullptr;
for (CXFA_Node* pFormChild =
pDestNodeParent->GetNodeItem(XFA_NODEITEM_FirstChild);
pFormChild;
@@ -310,7 +305,7 @@ static void XFA_ProtoMerge_MergeNodeRecurse(CXFA_Document* pDocument,
}
CXFA_Node* pNewNode = pProtoNode->Clone(TRUE);
pNewNode->SetTemplateNode(pProtoNode);
- pDestNodeParent->InsertChild(pNewNode, NULL);
+ pDestNodeParent->InsertChild(pNewNode, nullptr);
}
static void XFA_ProtoMerge_MergeNode(CXFA_Document* pDocument,
CXFA_Node* pDestNode,
@@ -392,7 +387,7 @@ void CXFA_Document::DoProtoMerge() {
if (!wsURI.IsEmpty() && wsURI != FX_WSTRC(L".")) {
continue;
}
- CXFA_Node* pProtoNode = NULL;
+ CXFA_Node* pProtoNode = nullptr;
if (!wsSOM.IsEmpty()) {
uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Attributes |
XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Parent |