From 382129e2bdb1337a5a82cbd96478aab02f9aff7d Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 11 Jan 2018 14:11:41 +0000 Subject: Rename GetCalculate to GetCalculateIfExists This CL makes it explicit that GetCalculate can return nullptr. Change-Id: I587e3bb442df3661f083f7058ff02a8d62478ed5 Reviewed-on: https://pdfium-review.googlesource.com/22681 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffdocview.cpp | 2 +- xfa/fxfa/cxfa_fffield.cpp | 2 +- xfa/fxfa/cxfa_ffwidgethandler.cpp | 4 ++-- xfa/fxfa/parser/cxfa_node.cpp | 4 ++-- xfa/fxfa/parser/cxfa_node.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index 52b7f64cf7..94931bda33 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp @@ -425,7 +425,7 @@ static int32_t XFA_ProcessEvent(CXFA_FFDocView* pDocView, } return XFA_EVENTERROR_Disabled; case XFA_EVENT_InitCalculate: { - CXFA_Calculate* calc = node->GetCalculate(); + CXFA_Calculate* calc = node->GetCalculateIfExists(); if (!calc) return XFA_EVENTERROR_NotExist; if (node->IsUserInteractive()) diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp index cf6c96a85d..9f885bb3ce 100644 --- a/xfa/fxfa/cxfa_fffield.cpp +++ b/xfa/fxfa/cxfa_fffield.cpp @@ -664,7 +664,7 @@ int32_t CXFA_FFField::CalculateOverride() { } int32_t CXFA_FFField::CalculateWidgetAcc(CXFA_WidgetAcc* pAcc) { - CXFA_Calculate* calc = pAcc->GetNode()->GetCalculate(); + CXFA_Calculate* calc = pAcc->GetNode()->GetCalculateIfExists(); if (!calc) return 1; diff --git a/xfa/fxfa/cxfa_ffwidgethandler.cpp b/xfa/fxfa/cxfa_ffwidgethandler.cpp index 87a013cee2..3a9ff9a316 100644 --- a/xfa/fxfa/cxfa_ffwidgethandler.cpp +++ b/xfa/fxfa/cxfa_ffwidgethandler.cpp @@ -194,7 +194,7 @@ bool CXFA_FFWidgetHandler::HasEvent(CXFA_WidgetAcc* pWidgetAcc, switch (eEventType) { case XFA_EVENT_Calculate: { - CXFA_Calculate* calc = node->GetCalculate(); + CXFA_Calculate* calc = node->GetCalculateIfExists(); return calc && calc->GetScript(); } case XFA_EVENT_Validate: { @@ -229,7 +229,7 @@ int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, } return XFA_EVENTERROR_Disabled; case XFA_EVENT_InitCalculate: { - CXFA_Calculate* calc = node->GetCalculate(); + CXFA_Calculate* calc = node->GetCalculateIfExists(); if (!calc) return XFA_EVENTERROR_NotExist; if (node->IsUserInteractive()) diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 093d83a67d..74263c7643 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -1604,7 +1604,7 @@ CXFA_Value* CXFA_Node::GetFormValue() const { return JSObject()->GetProperty(0, XFA_Element::Value); } -CXFA_Calculate* CXFA_Node::GetCalculate() const { +CXFA_Calculate* CXFA_Node::GetCalculateIfExists() const { return JSObject()->GetProperty(0, XFA_Element::Calculate); } @@ -1697,7 +1697,7 @@ int32_t CXFA_Node::ProcessCalculate(CXFA_FFDocView* docView) { if (GetElementType() == XFA_Element::Draw) return XFA_EVENTERROR_NotExist; - CXFA_Calculate* calc = GetCalculate(); + CXFA_Calculate* calc = GetCalculateIfExists(); if (!calc) return XFA_EVENTERROR_NotExist; if (IsUserInteractive()) diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h index ed3b21d1e2..cafe6676fd 100644 --- a/xfa/fxfa/parser/cxfa_node.h +++ b/xfa/fxfa/parser/cxfa_node.h @@ -248,7 +248,7 @@ class CXFA_Node : public CXFA_Object { CXFA_Margin* GetMarginIfExists() const; CXFA_Para* GetParaIfExists() const; - CXFA_Calculate* GetCalculate() const; + CXFA_Calculate* GetCalculateIfExists() const; CXFA_Validate* GetValidate() const; CXFA_Validate* GetOrCreateValidate(); -- cgit v1.2.3