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_fffield.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_fffield.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_fffield.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp index 05319b3dc9..2238648ab0 100644 --- a/xfa/fxfa/cxfa_fffield.cpp +++ b/xfa/fxfa/cxfa_fffield.cpp @@ -49,14 +49,16 @@ CFX_RectF CXFA_FFField::GetBBox(uint32_t dwStatus, bool bDrawFocus) { if (!bDrawFocus) return CXFA_FFWidget::GetBBox(dwStatus); - XFA_Element type = m_pNode->GetUIType(); - if (type != XFA_Element::Button && type != XFA_Element::CheckButton && - type != XFA_Element::ImageEdit && type != XFA_Element::Signature && - type != XFA_Element::ChoiceList) { - return CFX_RectF(); + switch (m_pNode->GetFFWidgetType()) { + case XFA_FFWidgetType::kButton: + case XFA_FFWidgetType::kCheckButton: + case XFA_FFWidgetType::kImageEdit: + case XFA_FFWidgetType::kSignature: + case XFA_FFWidgetType::kChoiceList: + return GetRotateMatrix().TransformRect(m_rtUI); + default: + return CFX_RectF(); } - - return GetRotateMatrix().TransformRect(m_rtUI); } void CXFA_FFField::RenderWidget(CXFA_Graphics* pGS, @@ -136,9 +138,10 @@ void CXFA_FFField::UnloadWidget() { } void CXFA_FFField::SetEditScrollOffset() { - XFA_Element eType = m_pNode->GetUIType(); - if (eType != XFA_Element::TextEdit && eType != XFA_Element::NumericEdit && - eType != XFA_Element::PasswordEdit) { + XFA_FFWidgetType eType = m_pNode->GetFFWidgetType(); + if (eType != XFA_FFWidgetType::kTextEdit && + eType != XFA_FFWidgetType::kNumericEdit && + eType != XFA_FFWidgetType::kPasswordEdit) { return; } @@ -333,7 +336,7 @@ void CXFA_FFField::UpdateFWL() { } uint32_t CXFA_FFField::UpdateUIProperty() { - CXFA_Node* pUiNode = m_pNode->GetUIChild(); + CXFA_Node* pUiNode = m_pNode->GetUIChildNode(); if (pUiNode && pUiNode->GetElementType() == XFA_Element::DefaultUi) return FWL_STYLEEXT_EDT_ReadOnly; return 0; |