diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-07-23 13:36:00 -0700 |
commit | f1e7c461dfabbff6b65a072f24f6711b34159361 (patch) | |
tree | 3b0bb772a59669f06b86824a444fd06642592d4b /fpdfsdk/src/fxedit/fxet_list.cpp | |
parent | 320b2313d19869333ed453af546e61a9fc2b81c9 (diff) | |
download | pdfium-f1e7c461dfabbff6b65a072f24f6711b34159361.tar.xz |
Revert "FX_BOOL considered harmful, part 2."
This reverts commit 320b2313d19869333ed453af546e61a9fc2b81c9.
Reason for revert: build failure.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1255693002 .
Diffstat (limited to 'fpdfsdk/src/fxedit/fxet_list.cpp')
-rw-r--r-- | fpdfsdk/src/fxedit/fxet_list.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp index c84db4d029..d94cc16c86 100644 --- a/fpdfsdk/src/fxedit/fxet_list.cpp +++ b/fpdfsdk/src/fxedit/fxet_list.cpp @@ -11,8 +11,8 @@ /* ------------------------------- CFX_ListItem ---------------------------------- */ CFX_ListItem::CFX_ListItem() : m_pEdit(NULL), - m_bSelected(false), - m_bCaret(false), + m_bSelected(FALSE), + m_bCaret(FALSE), m_rcListItem(0.0f,0.0f,0.0f,0.0f) { m_pEdit = IFX_Edit::NewEdit(); @@ -56,22 +56,22 @@ CLST_Rect CFX_ListItem::GetRect() const return m_rcListItem; } -bool CFX_ListItem::IsSelected() const +FX_BOOL CFX_ListItem::IsSelected() const { return m_bSelected; } -void CFX_ListItem::SetSelect(bool bSelected) +void CFX_ListItem::SetSelect(FX_BOOL bSelected) { m_bSelected = bSelected; } -bool CFX_ListItem::IsCaret() const +FX_BOOL CFX_ListItem::IsCaret() const { return m_bCaret; } -void CFX_ListItem::SetCaret(bool bCaret) +void CFX_ListItem::SetCaret(FX_BOOL bCaret) { m_bCaret = bCaret; } @@ -119,7 +119,7 @@ CFX_WideString CFX_ListItem::GetText() const /* ------------------------------------ CFX_List --------------------------------- */ -CFX_List::CFX_List() : m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(false) +CFX_List::CFX_List() : m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(FALSE) { } @@ -211,8 +211,8 @@ int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const { CPDF_Point pt = OuterToInner(point); - bool bFirst = true; - bool bLast = true; + FX_BOOL bFirst = TRUE; + FX_BOOL bLast = TRUE; for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) { @@ -222,12 +222,12 @@ int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const if (FX_EDIT_IsFloatBigger(pt.y, rcListItem.top)) { - bFirst = false; + bFirst = FALSE; } if (FX_EDIT_IsFloatSmaller(pt.y, rcListItem.bottom)) { - bLast = false; + bLast = FALSE; } if (pt.y >= rcListItem.top && pt.y < rcListItem.bottom) @@ -318,17 +318,17 @@ CPDF_Rect CFX_List::GetItemRect(int32_t nIndex) const return CPDF_Rect(); } -bool CFX_List::IsItemSelected(int32_t nIndex) const +FX_BOOL CFX_List::IsItemSelected(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { return pListItem->IsSelected(); } - return false; + return FALSE; } -void CFX_List::SetItemSelect(int32_t nItemIndex, bool bSelected) +void CFX_List::SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex)) { @@ -336,7 +336,7 @@ void CFX_List::SetItemSelect(int32_t nItemIndex, bool bSelected) } } -void CFX_List::SetItemCaret(int32_t nItemIndex, bool bCaret) +void CFX_List::SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex)) { @@ -344,17 +344,17 @@ void CFX_List::SetItemCaret(int32_t nItemIndex, bool bCaret) } } -void CFX_List::SetMultipleSel(bool bMultiple) +void CFX_List::SetMultipleSel(FX_BOOL bMultiple) { m_bMultiple = bMultiple; } -bool CFX_List::IsMultipleSel() const +FX_BOOL CFX_List::IsMultipleSel() const { return m_bMultiple; } -bool CFX_List::IsValid(int32_t nItemIndex) const +FX_BOOL CFX_List::IsValid(int32_t nItemIndex) const { return nItemIndex >= 0 && nItemIndex < m_aListItems.GetSize(); } @@ -446,7 +446,7 @@ int32_t CPLST_Select::Find(int32_t nItemIndex) const return -1; } -bool CPLST_Select::IsExist(int32_t nItemIndex) const +FX_BOOL CPLST_Select::IsExist(int32_t nItemIndex) const { return Find(nItemIndex) >= 0; } @@ -507,11 +507,11 @@ void CPLST_Select::Done() /* ------------------------------------ CFX_ListCtrl --------------------------------- */ CFX_ListCtrl::CFX_ListCtrl() : m_pNotify(NULL), - m_bNotifyFlag(false), + m_bNotifyFlag(FALSE), m_ptScrollPos(0.0f,0.0f), m_nSelItem(-1), m_nFootIndex(-1), - m_bCtrlSel(false), + m_bCtrlSel(FALSE), m_nCaretIndex(-1) { } @@ -557,7 +557,7 @@ CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect & rect) const return CPDF_Rect(ptLeftBottom.x,ptLeftBottom.y,ptRightTop.x,ptRightTop.y); } -void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl) +void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -569,13 +569,13 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl) { m_aSelItems.Sub(nHitIndex); SelectItems(); - m_bCtrlSel = false; + m_bCtrlSel = FALSE; } else { m_aSelItems.Add(nHitIndex); SelectItems(); - m_bCtrlSel = true; + m_bCtrlSel = TRUE; } m_nFootIndex = nHitIndex; @@ -606,7 +606,7 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,bool bShift,bool bCtrl) ScrollToListItem(nHitIndex); } -void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl) +void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) { int32_t nHitIndex = GetItemIndex(point); @@ -639,7 +639,7 @@ void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,bool bShift,bool bCtrl) ScrollToListItem(nHitIndex); } -void CFX_ListCtrl::OnVK(int32_t nItemIndex,bool bShift,bool bCtrl) +void CFX_ListCtrl::OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) { if (IsMultipleSel()) { @@ -674,37 +674,37 @@ void CFX_ListCtrl::OnVK(int32_t nItemIndex,bool bShift,bool bCtrl) ScrollToListItem(nItemIndex); } -void CFX_ListCtrl::OnVK_UP(bool bShift,bool bCtrl) +void CFX_ListCtrl::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) { OnVK(IsMultipleSel() ? GetCaret()-1 : GetSelect()-1, bShift, bCtrl); } -void CFX_ListCtrl::OnVK_DOWN(bool bShift,bool bCtrl) +void CFX_ListCtrl::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) { OnVK(IsMultipleSel() ? GetCaret()+1 : GetSelect()+1, bShift, bCtrl); } -void CFX_ListCtrl::OnVK_LEFT(bool bShift,bool bCtrl) +void CFX_ListCtrl::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) { OnVK(0, bShift, bCtrl); } -void CFX_ListCtrl::OnVK_RIGHT(bool bShift,bool bCtrl) +void CFX_ListCtrl::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) { OnVK(GetCount()-1, bShift, bCtrl); } -void CFX_ListCtrl::OnVK_HOME(bool bShift,bool bCtrl) +void CFX_ListCtrl::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) { OnVK(0, bShift, bCtrl); } -void CFX_ListCtrl::OnVK_END(bool bShift,bool bCtrl) +void CFX_ListCtrl::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) { OnVK(GetCount()-1, bShift, bCtrl); } -bool CFX_ListCtrl::OnChar(FX_WORD nChar,bool bShift,bool bCtrl) +FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) { int32_t nIndex = GetLastSelected(); int32_t nFindIndex = FindNext(nIndex,nChar); @@ -712,9 +712,9 @@ bool CFX_ListCtrl::OnChar(FX_WORD nChar,bool bShift,bool bCtrl) if (nFindIndex != nIndex) { OnVK(nFindIndex, bShift, bCtrl); - return true; + return TRUE; } - return false; + return FALSE; } /* -------- inner methods ------- */ @@ -739,7 +739,7 @@ void CFX_ListCtrl::AddString(const FX_WCHAR* string) ReArrange(GetCount() - 1); } -void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, bool bSelected) +void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected) { if (!IsValid(nItemIndex)) return; @@ -747,12 +747,12 @@ void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, bool bSelected) { if (bSelected) { - SetItemSelect(nItemIndex,true); + SetItemSelect(nItemIndex,TRUE); InvalidateItem(nItemIndex); } else { - SetItemSelect(nItemIndex,false); + SetItemSelect(nItemIndex,FALSE); InvalidateItem(nItemIndex); } } @@ -766,11 +766,11 @@ void CFX_ListCtrl::SetSingleSelect(int32_t nItemIndex) { if (m_nSelItem >= 0) { - SetItemSelect(m_nSelItem,false); + SetItemSelect(m_nSelItem,FALSE); InvalidateItem(m_nSelItem); } - SetItemSelect(nItemIndex,true); + SetItemSelect(nItemIndex,TRUE); InvalidateItem(nItemIndex); m_nSelItem = nItemIndex; } @@ -788,8 +788,8 @@ void CFX_ListCtrl::SetCaret(int32_t nItemIndex) { m_nCaretIndex = nItemIndex; - SetItemCaret(nOldIndex, false); - SetItemCaret(nItemIndex,true); + SetItemCaret(nOldIndex, FALSE); + SetItemCaret(nItemIndex,TRUE); InvalidateItem(nOldIndex); InvalidateItem(nItemIndex); @@ -805,17 +805,17 @@ void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex) { if (!m_bNotifyFlag) { - m_bNotifyFlag = true; + m_bNotifyFlag = TRUE; CPDF_Rect rcRefresh = GetPlateRect(); m_pNotify->IOnInvalidateRect(&rcRefresh); - m_bNotifyFlag = false; + m_bNotifyFlag = FALSE; } } else { if (!m_bNotifyFlag) { - m_bNotifyFlag = true; + m_bNotifyFlag = TRUE; CPDF_Rect rcRefresh = GetItemRect(nItemIndex); rcRefresh.left -= 1.0f; rcRefresh.right += 1.0f; @@ -823,7 +823,7 @@ void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex) rcRefresh.top += 1.0f; m_pNotify->IOnInvalidateRect(&rcRefresh); - m_bNotifyFlag = false; + m_bNotifyFlag = FALSE; } } } @@ -839,10 +839,10 @@ void CFX_ListCtrl::SelectItems() switch(nState) { case 1: - SetMultipleSelect(nItemIndex, true); + SetMultipleSelect(nItemIndex, TRUE); break; case -1: - SetMultipleSelect(nItemIndex, false); + SetMultipleSelect(nItemIndex, FALSE); break; } } @@ -863,7 +863,7 @@ void CFX_ListCtrl::Select(int32_t nItemIndex) SetSingleSelect(nItemIndex); } -bool CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const +FX_BOOL CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const { CPDF_Rect rcPlate = GetPlateRect(); CPDF_Rect rcItem = GetItemRect(nItemIndex); @@ -904,10 +904,10 @@ void CFX_ListCtrl::SetScrollInfo() if (!m_bNotifyFlag) { - m_bNotifyFlag = true; + m_bNotifyFlag = TRUE; m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top, rcContent.bottom, rcContent.top, GetFirstHeight(), rcPlate.Height()); - m_bNotifyFlag = false; + m_bNotifyFlag = FALSE; } } } @@ -947,9 +947,9 @@ void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy) { if (!m_bNotifyFlag) { - m_bNotifyFlag = true; + m_bNotifyFlag = TRUE; m_pNotify->IOnSetScrollPosY(fy); - m_bNotifyFlag = false; + m_bNotifyFlag = FALSE; } } } |