diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-29 19:52:07 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-29 19:52:07 +0000 |
commit | 5e332f1275dd6f4b6d487d313f4db8497df339ab (patch) | |
tree | f15dbf8d89ed59808c7ff21ef8685ea8d1e65797 /xfa/fxfa/cxfa_fftextedit.cpp | |
parent | d6e92bd6e874a4709144effc79163ef3c13d4b2e (diff) | |
download | pdfium-5e332f1275dd6f4b6d487d313f4db8497df339ab.tar.xz |
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 <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_fftextedit.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_fftextedit.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp index d3c6fa6ad6..ad03b5273b 100644 --- a/xfa/fxfa/cxfa_fftextedit.cpp +++ b/xfa/fxfa/cxfa_fftextedit.cpp @@ -192,7 +192,7 @@ bool CXFA_FFTextEdit::CommitData() { } void CXFA_FFTextEdit::ValidateNumberField(const WideString& wsText) { - if (GetNode()->GetUIType() != XFA_Element::NumericEdit) + if (GetNode()->GetFFWidgetType() != XFA_FFWidgetType::kNumericEdit) return; IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider(); @@ -258,7 +258,7 @@ bool CXFA_FFTextEdit::UpdateFWLData() { eType = XFA_VALUEPICTURE_Edit; bool bUpdate = false; - if (m_pNode->GetUIType() == XFA_Element::TextEdit && + if (m_pNode->GetFFWidgetType() == XFA_FFWidgetType::kTextEdit && !m_pNode->GetNumberOfCells()) { XFA_Element elementType; int32_t iMaxChars; @@ -269,7 +269,7 @@ bool CXFA_FFTextEdit::UpdateFWLData() { pEdit->SetLimit(iMaxChars); bUpdate = true; } - } else if (m_pNode->GetUIType() == XFA_Element::Barcode) { + } else if (m_pNode->GetFFWidgetType() == XFA_FFWidgetType::kBarcode) { int32_t nDataLen = 0; if (eType == XFA_VALUEPICTURE_Edit) nDataLen = m_pNode->GetBarcodeAttribute_DataLength().value_or(0); @@ -300,7 +300,7 @@ void CXFA_FFTextEdit::OnTextChanged(CFWL_Widget* pWidget, eParam.m_pTarget = m_pNode.Get(); eParam.m_wsPrevText = wsPrevText; CFWL_Edit* pEdit = static_cast<CFWL_Edit*>(m_pNormalWidget.get()); - if (m_pNode->GetUIType() == XFA_Element::DateTimeEdit) { + if (m_pNode->GetFFWidgetType() == XFA_FFWidgetType::kDateTimeEdit) { CFWL_DateTimePicker* pDateTime = (CFWL_DateTimePicker*)pEdit; eParam.m_wsNewText = pDateTime->GetEditText(); if (pDateTime->HasSelection()) { @@ -324,7 +324,8 @@ void CXFA_FFTextEdit::OnTextFull(CFWL_Widget* pWidget) { } bool CXFA_FFTextEdit::CheckWord(const ByteStringView& sWord) { - return sWord.IsEmpty() || m_pNode->GetUIType() != XFA_Element::TextEdit; + return sWord.IsEmpty() || + m_pNode->GetFFWidgetType() != XFA_FFWidgetType::kTextEdit; } void CXFA_FFTextEdit::OnProcessMessage(CFWL_Message* pMessage) { |