diff options
author | tsepez <tsepez@chromium.org> | 2016-06-09 11:46:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-09 11:46:16 -0700 |
commit | 20d6b76d82a762e75e8c2a89976f93acd9af7467 (patch) | |
tree | 9142c0179606d9909158678559e0adcac8b9991f /xfa/fxfa/app/xfa_ffwidgethandler.cpp | |
parent | e64c3c60bdc1ca2e937e4317a9238ab4c210dfe5 (diff) | |
download | pdfium-20d6b76d82a762e75e8c2a89976f93acd9af7467.tar.xz |
Use static_cast<CXFA_WidgetAcc*> in xfa.
Remove a few other unused casts, simplify.
Review-Url: https://codereview.chromium.org/2052593003
Diffstat (limited to 'xfa/fxfa/app/xfa_ffwidgethandler.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffwidgethandler.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp index 027c3d9fa8..534a08a4e3 100644 --- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp +++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp @@ -47,9 +47,8 @@ FX_BOOL CXFA_FFWidgetHandler::OnLButtonDown(CXFA_FFWidget* hWidget, hWidget->Rotate2Normal(fx, fy); FX_BOOL bRet = hWidget->OnLButtonDown(dwFlags, fx, fy); if (bRet && m_pDocView->SetFocus(hWidget)) { - ((CXFA_FFDoc*)m_pDocView->GetDoc()) - ->GetDocProvider() - ->SetFocusWidget(m_pDocView->GetDoc(), (CXFA_FFWidget*)hWidget); + m_pDocView->GetDoc()->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), + hWidget); } m_pDocView->UnlockUpdate(); m_pDocView->UpdateDocView(); @@ -107,9 +106,8 @@ FX_BOOL CXFA_FFWidgetHandler::OnRButtonDown(CXFA_FFWidget* hWidget, hWidget->Rotate2Normal(fx, fy); FX_BOOL bRet = hWidget->OnRButtonDown(dwFlags, fx, fy); if (bRet && m_pDocView->SetFocus(hWidget)) { - ((CXFA_FFDoc*)m_pDocView->GetDoc()) - ->GetDocProvider() - ->SetFocusWidget(m_pDocView->GetDoc(), (CXFA_FFWidget*)hWidget); + m_pDocView->GetDoc()->GetDocProvider()->SetFocusWidget(m_pDocView->GetDoc(), + hWidget); } m_pDocView->RunInvalidate(); return bRet; @@ -228,9 +226,8 @@ int32_t CXFA_FFWidgetHandler::ProcessEvent(CXFA_WidgetAcc* pWidgetAcc, case XFA_EVENT_Calculate: return pWidgetAcc->ProcessCalculate(); case XFA_EVENT_Validate: - if (((CXFA_FFDoc*)m_pDocView->GetDoc()) - ->GetDocProvider() - ->IsValidationsEnabled(m_pDocView->GetDoc())) { + if (m_pDocView->GetDoc()->GetDocProvider()->IsValidationsEnabled( + m_pDocView->GetDoc())) { return pWidgetAcc->ProcessValidate(); } return XFA_EVENTERROR_Disabled; @@ -269,7 +266,7 @@ CXFA_FFWidget* CXFA_FFWidgetHandler::CreateWidget(CXFA_FFWidget* hParent, m_pDocView->RunLayout(); CXFA_LayoutItem* pLayout = m_pDocView->GetXFALayout()->GetLayoutItem(pNewFormItem); - return (CXFA_FFWidget*)pLayout; + return static_cast<CXFA_FFWidget*>(pLayout); } CXFA_Node* CXFA_FFWidgetHandler::CreateWidgetFormItem( @@ -550,6 +547,6 @@ CXFA_Document* CXFA_FFWidgetHandler::GetObjFactory() const { } CXFA_Document* CXFA_FFWidgetHandler::GetXFADoc() const { - return ((CXFA_FFDoc*)(m_pDocView->GetDoc()))->GetXFADoc(); + return m_pDocView->GetDoc()->GetXFADoc(); } |