summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-27 11:55:29 -0700
commitff46aaf499edcf153ee2f57c7016587aa96dcfa0 (patch)
tree0a0d92713af476897899b126d180cc6294433d10 /fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
parentaafeff816e22c1333c17d8a0eb4fe8927c28142d (diff)
downloadpdfium-ff46aaf499edcf153ee2f57c7016587aa96dcfa0.tar.xz
FX Bool considered harmful, part 3
Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_ListBox.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListBox.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index 48fb409b7b..d0e9cc6dfd 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -49,7 +49,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (pScroll->IsVisible())
{
- pScroll->SetVisible(FALSE);
+ pScroll->SetVisible(false);
m_pList->RePosChildWnd();
}
}
@@ -57,7 +57,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax,
{
if (!pScroll->IsVisible())
{
- pScroll->SetVisible(TRUE);
+ pScroll->SetVisible(true);
m_pList->RePosChildWnd();
}
}
@@ -79,8 +79,8 @@ void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect * pRect)
CPWL_ListBox::CPWL_ListBox() :
m_pList(NULL),
m_pListNotify(NULL),
- m_bMouseDown(FALSE),
- m_bHoverSel(FALSE),
+ m_bMouseDown(false),
+ m_bHoverSel(false),
m_pFillerNotify(NULL)
{
m_pList = IFX_List::NewList();
@@ -229,16 +229,16 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pU
}
}
-FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnKeyDown(nChar, nFlag);
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
switch (nChar)
{
default:
- return FALSE;
+ return false;
case FWL_VKEY_Up:
case FWL_VKEY_Down:
case FWL_VKEY_Home:
@@ -272,33 +272,33 @@ FX_BOOL CPWL_ListBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag)
break;
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit,nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(true,bExit,nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
+bool CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag)
{
CPWL_Wnd::OnChar(nChar,nFlag);
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
- if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return FALSE;
+ if (!m_pList->OnChar(nChar,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag))) return false;
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(TRUE,bExit, nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(true,bExit, nFlag);
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonDown(point,nFlag);
if (ClientHitTest(point))
{
- m_bMouseDown = TRUE;
+ m_bMouseDown = true;
SetFocus();
SetCapture();
@@ -306,31 +306,31 @@ FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
-FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnLButtonUp(point,nFlag);
if (m_bMouseDown)
{
ReleaseCapture();
- m_bMouseDown = FALSE;
+ m_bMouseDown = false;
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit,nFlag);
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit,nFlag);
- return TRUE;
+ return true;
}
-void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel)
+void CPWL_ListBox::SetHoverSel(bool bHoverSel)
{
m_bHoverSel = bHoverSel;
}
-FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
{
CPWL_Wnd::OnMouseMove(point, nFlag);
@@ -346,7 +346,7 @@ FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag)
m_pList->OnMouseMove(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- return TRUE;
+ return true;
}
void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intptr_t lParam)
@@ -405,19 +405,19 @@ void CPWL_ListBox::RePosChildWnd()
m_pList->SetPlateRect(GetListRect());
}
-void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit, FX_DWORD nFlag)
+void CPWL_ListBox::OnNotifySelChanged(bool bKeyDown, bool & bExit, FX_DWORD nFlag)
{
if (m_pFillerNotify)
{
- FX_BOOL bRC = TRUE;
+ bool bRC = true;
CFX_WideString swChange = GetText();
CFX_WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = swChange.GetLength();
- m_pFillerNotify->OnBeforeKeyStroke(FALSE, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
+ m_pFillerNotify->OnBeforeKeyStroke(false, GetAttachedData(), 0, swChange, strChangeEx, nSelStart, nSelEnd, bKeyDown, bRC, bExit, nFlag);
if (bExit) return;
- m_pFillerNotify->OnAfterKeyStroke(FALSE, GetAttachedData(), bExit,nFlag);
+ m_pFillerNotify->OnAfterKeyStroke(false, GetAttachedData(), bExit,nFlag);
}
}
@@ -498,12 +498,12 @@ void CPWL_ListBox::Reset()
m_pList->Cancel();
}
-FX_BOOL CPWL_ListBox::IsMultipleSel() const
+bool CPWL_ListBox::IsMultipleSel() const
{
if (m_pList)
return m_pList->IsMultipleSel();
- return FALSE;
+ return false;
}
int32_t CPWL_ListBox::GetCaretIndex() const
@@ -522,12 +522,12 @@ int32_t CPWL_ListBox::GetCurSel() const
return -1;
}
-FX_BOOL CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
+bool CPWL_ListBox::IsItemSelected(int32_t nItemIndex) const
{
if (m_pList)
return m_pList->IsItemSelected(nItemIndex);
- return FALSE;
+ return false;
}
int32_t CPWL_ListBox::GetTopVisibleIndex() const
@@ -578,9 +578,9 @@ CPDF_Rect CPWL_ListBox::GetListRect() const
return CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth()));
}
-FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
+bool CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DWORD nFlag)
{
- if (!m_pList) return FALSE;
+ if (!m_pList) return false;
if (zDelta < 0)
{
@@ -591,8 +591,8 @@ FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta, const CPDF_Point & point, FX_DW
m_pList->OnVK_UP(IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag));
}
- FX_BOOL bExit = FALSE;
- OnNotifySelChanged(FALSE,bExit, nFlag);
- return TRUE;
+ bool bExit = false;
+ OnNotifySelChanged(false,bExit, nFlag);
+ return true;
}