summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_notedriver.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-05-11 18:37:26 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-11 18:37:26 +0000
commitce7a8158376dd81e2321a77a331dca5f451b471c (patch)
tree9de6a5e8356c8392bfe6890cc4822cadd5b56dae /xfa/fwl/cfwl_notedriver.cpp
parentddfa5177021f76b4d84c6fbdce964ab3ca17e046 (diff)
downloadpdfium-ce7a8158376dd81e2321a77a331dca5f451b471c.tar.xz
Remove CFWL_WidgetMgr::IsFormDisabled().
This method always returns true, so make that assumption and clean up dead code. More cleanups will follow this one to remove the code that can now be inferred to be dead. Change-Id: I73f077561ab511a1c2c09ac6990ab5cdc5bfb055 Reviewed-on: https://pdfium-review.googlesource.com/32391 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_notedriver.cpp')
-rw-r--r--xfa/fwl/cfwl_notedriver.cpp51
1 files changed, 6 insertions, 45 deletions
diff --git a/xfa/fwl/cfwl_notedriver.cpp b/xfa/fwl/cfwl_notedriver.cpp
index 9a19f4b8a7..f585625882 100644
--- a/xfa/fwl/cfwl_notedriver.cpp
+++ b/xfa/fwl/cfwl_notedriver.cpp
@@ -185,11 +185,7 @@ CFWL_NoteLoop* CFWL_NoteDriver::GetTopLoop() const {
}
void CFWL_NoteDriver::ProcessMessage(std::unique_ptr<CFWL_Message> pMessage) {
- CFWL_WidgetMgr* pWidgetMgr =
- pMessage->m_pDstTarget->GetOwnerApp()->GetWidgetMgr();
- CFWL_Widget* pMessageForm = pWidgetMgr->IsFormDisabled()
- ? pMessage->m_pDstTarget
- : GetMessageForm(pMessage->m_pDstTarget);
+ CFWL_Widget* pMessageForm = pMessage->m_pDstTarget;
if (!pMessageForm)
return;
@@ -239,50 +235,15 @@ bool CFWL_NoteDriver::DispatchMessage(CFWL_Message* pMessage,
bool CFWL_NoteDriver::DoSetFocus(CFWL_Message* pMessage,
CFWL_Widget* pMessageForm) {
- CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr();
- if (pWidgetMgr->IsFormDisabled()) {
- m_pFocus = pMessage->m_pDstTarget;
- return true;
- }
-
- CFWL_Widget* pWidget = pMessage->m_pDstTarget;
- if (!pWidget)
- return false;
-
- CFWL_Form* pForm = static_cast<CFWL_Form*>(pWidget);
- CFWL_Widget* pSubFocus = pForm->GetSubFocus();
- if (pSubFocus && ((pSubFocus->GetStates() & FWL_WGTSTATE_Focused) == 0)) {
- pMessage->m_pDstTarget = pSubFocus;
- if (m_pFocus != pMessage->m_pDstTarget) {
- m_pFocus = pMessage->m_pDstTarget;
- return true;
- }
- }
- return false;
+ m_pFocus = pMessage->m_pDstTarget;
+ return true;
}
bool CFWL_NoteDriver::DoKillFocus(CFWL_Message* pMessage,
CFWL_Widget* pMessageForm) {
- CFWL_WidgetMgr* pWidgetMgr = pMessageForm->GetOwnerApp()->GetWidgetMgr();
- if (pWidgetMgr->IsFormDisabled()) {
- if (m_pFocus == pMessage->m_pDstTarget)
- m_pFocus = nullptr;
- return true;
- }
-
- CFWL_Form* pForm = static_cast<CFWL_Form*>(pMessage->m_pDstTarget);
- if (!pForm)
- return false;
-
- CFWL_Widget* pSubFocus = pForm->GetSubFocus();
- if (pSubFocus && (pSubFocus->GetStates() & FWL_WGTSTATE_Focused)) {
- pMessage->m_pDstTarget = pSubFocus;
- if (m_pFocus == pMessage->m_pDstTarget) {
- m_pFocus = nullptr;
- return true;
- }
- }
- return false;
+ if (m_pFocus == pMessage->m_pDstTarget)
+ m_pFocus = nullptr;
+ return true;
}
bool CFWL_NoteDriver::DoKey(CFWL_Message* pMessage, CFWL_Widget* pMessageForm) {