From 5e332f1275dd6f4b6d487d313f4db8497df339ab Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 29 Jan 2018 19:52:07 +0000 Subject: Cleanup the FFWidget determination code. This CL converts the UIType to an XFA_FFWidgetType instead of reusing the XFA_Element type. The creation code is cleaned up to make it clearer what's happening. Change-Id: I5d3e4967d5c8b8a50dbb25e574b0d31fe0cf407a Reviewed-on: https://pdfium-review.googlesource.com/24390 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- fxjs/xfa/cjx_field.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fxjs/xfa/cjx_field.cpp') diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp index 9b4364bc14..078def3cf9 100644 --- a/fxjs/xfa/cjx_field.cpp +++ b/fxjs/xfa/cjx_field.cpp @@ -249,7 +249,8 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue, if (pValue && !(pValue->IsNull() || pValue->IsUndefined())) wsNewText = pValue->ToWideString(); - if (xfaNode->GetUIChild()->GetElementType() == XFA_Element::NumericEdit) { + if (xfaNode->GetUIChildNode()->GetElementType() == + XFA_Element::NumericEdit) { wsNewText = xfaNode->NumericLimit(wsNewText, xfaNode->GetLeadDigits(), xfaNode->GetFracDigits()); } @@ -272,7 +273,8 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue, CXFA_Node* formValue = xfaNode->GetFormValueIfExists(); CXFA_Node* pNode = formValue ? formValue->GetFirstChild() : nullptr; if (pNode && pNode->GetElementType() == XFA_Element::Decimal) { - if (xfaNode->GetUIChild()->GetElementType() == XFA_Element::NumericEdit && + if (xfaNode->GetUIChildNode()->GetElementType() == + XFA_Element::NumericEdit && (pNode->JSObject()->GetInteger(XFA_Attribute::FracDigits) == -1)) { pValue->SetString(content.UTF8Encode().AsStringView()); } else { -- cgit v1.2.3