Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(926)

Unified Diff: fpdfsdk/pdfwindow/PWL_ComboBox.cpp

Issue 2162873003: Remove m_pList conditionals from CPWL_ListBox (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@bug_628995
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/pdfwindow/PWL_ListBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/pdfwindow/PWL_ComboBox.cpp
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index 5184cfe70a5c4fd0c2fc36ddc02172859e2ca9fb..dd899beba9dae89740ca2260fea420c42305db30 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -26,35 +26,27 @@ FX_BOOL CPWL_CBListBox::OnLButtonUp(const CFX_FloatPoint& point,
uint32_t nFlag) {
CPWL_Wnd::OnLButtonUp(point, nFlag);
- if (m_bMouseDown) {
- ReleaseCapture();
- m_bMouseDown = FALSE;
-
- if (ClientHitTest(point)) {
- if (CPWL_Wnd* pParent = GetParentWindow()) {
- pParent->OnNotify(this, PNM_LBUTTONUP, 0,
- PWL_MAKEDWORD(point.x, point.y));
- }
+ if (!m_bMouseDown)
+ return TRUE;
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE, bExit, nFlag);
- if (bExit)
- return FALSE;
- }
- }
+ ReleaseCapture();
+ m_bMouseDown = FALSE;
- return TRUE;
+ if (!ClientHitTest(point))
+ return TRUE;
+ if (CPWL_Wnd* pParent = GetParentWindow())
+ pParent->OnNotify(this, PNM_LBUTTONUP, 0, PWL_MAKEDWORD(point.x, point.y));
+
+ FX_BOOL bExit = FALSE;
+ OnNotifySelChanged(FALSE, bExit, nFlag);
+
+ return !bExit;
}
FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(uint16_t nChar,
FX_BOOL& bExit,
uint32_t nFlag) {
- if (!m_pList)
- return FALSE;
-
switch (nChar) {
- default:
- return FALSE;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -62,6 +54,8 @@ FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(uint16_t nChar,
case FWL_VKEY_End:
case FWL_VKEY_Right:
break;
+ default:
+ return FALSE;
}
switch (nChar) {
@@ -95,15 +89,10 @@ FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(uint16_t nChar,
FX_BOOL CPWL_CBListBox::OnCharWithExit(uint16_t nChar,
FX_BOOL& bExit,
uint32_t nFlag) {
- if (!m_pList)
- return FALSE;
-
if (!m_pList->OnChar(nChar, IsSHIFTpressed(nFlag), IsCTRLpressed(nFlag)))
return FALSE;
-
- if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow()) {
+ if (CPWL_ComboBox* pComboBox = (CPWL_ComboBox*)GetParentWindow())
pComboBox->SetSelectText();
- }
OnNotifySelChanged(TRUE, bExit, nFlag);
« no previous file with comments | « no previous file | fpdfsdk/pdfwindow/PWL_ListBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698