Remove CFWL_WidgetMgr::NextTab(). It always returns nullptr after traversing the entire tree. In turn, remove logic that could only occur following a non-null return. Bug: pdfium:1578 Change-Id: I98abfe329e0e6221bf6771593d7bb256d7401cca Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/72650 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp index 2503ef6..6259c3c 100644 --- a/xfa/fwl/cfwl_notedriver.cpp +++ b/xfa/fwl/cfwl_notedriver.cpp
@@ -171,22 +171,6 @@ #if !defined(OS_APPLE) if (pMsg->m_dwCmd == CFWL_MessageKey::Type::kKeyDown && pMsg->m_dwKeyCode == XFA_FWL_VKEY_Tab) { - CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr(); - CFWL_Widget* pForm = GetMessageForm(pMsg->GetDstTarget()); - CFWL_Widget* pFocus = m_pFocus.Get(); - if (m_pFocus && pWidgetMgr->GetSystemFormWidget(m_pFocus.Get()) != pForm) - pFocus = nullptr; - - CFWL_Widget* pNextTabStop = nullptr; - if (pForm) { - pNextTabStop = CFWL_WidgetMgr::NextTab(pForm, pFocus); - if (!pNextTabStop) - pNextTabStop = CFWL_WidgetMgr::NextTab(pForm, nullptr); - } - if (pNextTabStop == pFocus) - return true; - if (pNextTabStop) - SetFocus(pNextTabStop); return true; } #endif
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index bd9afd0..57fada3 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -20,20 +20,6 @@ CFWL_WidgetMgr::~CFWL_WidgetMgr() = default; -// static -CFWL_Widget* CFWL_WidgetMgr::NextTab(CFWL_Widget* parent, CFWL_Widget* focus) { - CFWL_WidgetMgr* pMgr = parent->GetOwnerApp()->GetWidgetMgr(); - CFWL_Widget* child = pMgr->GetFirstChildWidget(parent); - while (child) { - CFWL_Widget* bRet = NextTab(child, focus); - if (bRet) - return bRet; - - child = pMgr->GetNextSiblingWidget(child); - } - return nullptr; -} - CFWL_Widget* CFWL_WidgetMgr::GetParentWidget(const CFWL_Widget* pWidget) const { Item* pItem = GetWidgetMgrItem(pWidget); return pItem && pItem->pParent ? pItem->pParent->pWidget : nullptr;
diff --git a/xfa/fwl/cfwl_widgetmgr.h b/xfa/fwl/cfwl_widgetmgr.h index 59f5751..4562716 100644 --- a/xfa/fwl/cfwl_widgetmgr.h +++ b/xfa/fwl/cfwl_widgetmgr.h
@@ -34,8 +34,6 @@ explicit CFWL_WidgetMgr(AdapterIface* pAdapterNative); ~CFWL_WidgetMgr(); - static CFWL_Widget* NextTab(CFWL_Widget* parent, CFWL_Widget* focus); - void OnProcessMessageToForm(std::unique_ptr<CFWL_Message> pMessage); void OnDrawWidget(CFWL_Widget* pWidget, CXFA_Graphics* pGraphics,