summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_widgetdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-02 19:06:57 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-02 19:06:57 +0000
commitb31433fdaf92a15edfd920043aea5293ccc7e73e (patch)
tree4ed220a54e4405f2b872e7a9a105cfd8ec0ee00c /xfa/fxfa/parser/cxfa_widgetdata.cpp
parent7261c277173ad6ea589d2df6ef20f876c2798be4 (diff)
downloadpdfium-b31433fdaf92a15edfd920043aea5293ccc7e73e.tar.xz
Remove default value from CJX_Node::TryInteger
This CL removes the default param from TryInteger and inlines into the call sites. Change-Id: If3325c717a1127d4dcf665a12980925877988a9c Reviewed-on: https://pdfium-review.googlesource.com/17531 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_widgetdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index f6e0f7d55b..a0ac520981 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -1403,23 +1403,33 @@ int32_t CXFA_WidgetData::GetMaxChars(XFA_Element& eType) {
}
bool CXFA_WidgetData::GetFracDigits(int32_t& iFracDigits) {
- if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value)) {
- if (CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal))
- return pChild->JSNode()->TryInteger(XFA_ATTRIBUTE_FracDigits,
- iFracDigits);
- }
iFracDigits = -1;
- return false;
+
+ CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value);
+ if (!pNode)
+ return false;
+
+ CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal);
+ if (!pChild)
+ return false;
+
+ return pChild->JSNode()->TryInteger(XFA_ATTRIBUTE_FracDigits, iFracDigits,
+ true);
}
bool CXFA_WidgetData::GetLeadDigits(int32_t& iLeadDigits) {
- if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value)) {
- if (CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal))
- return pChild->JSNode()->TryInteger(XFA_ATTRIBUTE_LeadDigits,
- iLeadDigits);
- }
iLeadDigits = -1;
- return false;
+
+ CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Value);
+ if (!pNode)
+ return false;
+
+ CXFA_Node* pChild = pNode->GetChild(0, XFA_Element::Decimal);
+ if (!pChild)
+ return false;
+
+ return pChild->JSNode()->TryInteger(XFA_ATTRIBUTE_LeadDigits, iLeadDigits,
+ true);
}
bool CXFA_WidgetData::SetValue(const WideString& wsValue,