From bb17868d736f698d5217c30d52c5bbfed62c5936 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 9 Jun 2015 11:30:25 -0700 Subject: Use stdint.h types throughout PDFium. It's redundant nowadays to provide our own equivalents, now that this is done for us by the system header. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1177483002 --- fpdfsdk/src/fxedit/fxet_list.cpp | 122 +++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 61 deletions(-) (limited to 'fpdfsdk/src/fxedit/fxet_list.cpp') diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp index 64ed694d12..03b23020b4 100644 --- a/fpdfsdk/src/fxedit/fxet_list.cpp +++ b/fpdfsdk/src/fxedit/fxet_list.cpp @@ -130,7 +130,7 @@ CFX_List::~CFX_List() void CFX_List::Empty() { - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); iGetRect().bottom; - for (FX_INT32 i=nItemIndex,sz=m_aListItems.GetSize(); i=0; i--) + for (int32_t i=m_aListItems.GetSize()-1; i>=0; i--) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -286,11 +286,11 @@ FX_WCHAR CFX_List::Toupper(FX_WCHAR c) const return c; } -FX_INT32 CFX_List::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const +int32_t CFX_List::FindNext(int32_t nIndex,FX_WCHAR nChar) const { - FX_INT32 nCircleIndex = nIndex; + int32_t nCircleIndex = nIndex; - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i= sz) nCircleIndex = 0; @@ -305,7 +305,7 @@ FX_INT32 CFX_List::FindNext(FX_INT32 nIndex,FX_WCHAR nChar) const return nCircleIndex; } -CPDF_Rect CFX_List::GetItemRect(FX_INT32 nIndex) const +CPDF_Rect CFX_List::GetItemRect(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -318,7 +318,7 @@ CPDF_Rect CFX_List::GetItemRect(FX_INT32 nIndex) const return CPDF_Rect(); } -FX_BOOL CFX_List::IsItemSelected(FX_INT32 nIndex) const +FX_BOOL CFX_List::IsItemSelected(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -328,7 +328,7 @@ FX_BOOL CFX_List::IsItemSelected(FX_INT32 nIndex) const return FALSE; } -void CFX_List::SetItemSelect(FX_INT32 nItemIndex, FX_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(FX_INT32 nItemIndex, FX_BOOL bSelected) } } -void CFX_List::SetItemCaret(FX_INT32 nItemIndex, FX_BOOL bCaret) +void CFX_List::SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nItemIndex)) { @@ -354,12 +354,12 @@ FX_BOOL CFX_List::IsMultipleSel() const return m_bMultiple; } -FX_BOOL CFX_List::IsValid(FX_INT32 nItemIndex) const +FX_BOOL CFX_List::IsValid(int32_t nItemIndex) const { return nItemIndex >= 0 && nItemIndex < m_aListItems.GetSize(); } -CFX_WideString CFX_List::GetItemText(FX_INT32 nIndex) const +CFX_WideString CFX_List::GetItemText(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -377,15 +377,15 @@ CPLST_Select::CPLST_Select() CPLST_Select::~CPLST_Select() { - for (FX_INT32 i=0,sz=m_aItems.GetSize(); i nEndIndex) { - FX_INT32 nTemp = nEndIndex; + int32_t nTemp = nEndIndex; nEndIndex = nBeginIndex; nBeginIndex = nTemp; } - for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Add(i); + for (int32_t i=nBeginIndex; i<=nEndIndex; i++) Add(i); } -void CPLST_Select::Sub(FX_INT32 nItemIndex) +void CPLST_Select::Sub(int32_t nItemIndex) { - for (FX_INT32 i=m_aItems.GetSize()-1; i>=0; i--) + for (int32_t i=m_aItems.GetSize()-1; i>=0; i--) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) if (pItem->nItemIndex == nItemIndex) @@ -420,21 +420,21 @@ void CPLST_Select::Sub(FX_INT32 nItemIndex) } } -void CPLST_Select::Sub(FX_INT32 nBeginIndex, FX_INT32 nEndIndex) +void CPLST_Select::Sub(int32_t nBeginIndex, int32_t nEndIndex) { if (nBeginIndex > nEndIndex) { - FX_INT32 nTemp = nEndIndex; + int32_t nTemp = nEndIndex; nEndIndex = nBeginIndex; nBeginIndex = nTemp; } - for (FX_INT32 i=nBeginIndex; i<=nEndIndex; i++) Sub(i); + for (int32_t i=nBeginIndex; i<=nEndIndex; i++) Sub(i); } -FX_INT32 CPLST_Select::Find(FX_INT32 nItemIndex) const +int32_t CPLST_Select::Find(int32_t nItemIndex) const { - for (FX_INT32 i=0,sz=m_aItems.GetSize(); i= 0; } -FX_INT32 CPLST_Select::GetCount() const +int32_t CPLST_Select::GetCount() const { return m_aItems.GetSize(); } -FX_INT32 CPLST_Select::GetItemIndex(FX_INT32 nIndex) const +int32_t CPLST_Select::GetItemIndex(int32_t nIndex) const { if (nIndex >= 0 && nIndex < m_aItems.GetSize()) if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex)) @@ -465,7 +465,7 @@ FX_INT32 CPLST_Select::GetItemIndex(FX_INT32 nIndex) const return -1; } -FX_INT32 CPLST_Select::GetState(FX_INT32 nIndex) const +int32_t CPLST_Select::GetState(int32_t nIndex) const { if (nIndex >= 0 && nIndex < m_aItems.GetSize()) if (CPLST_Select_Item * pItem = m_aItems.GetAt(nIndex)) @@ -476,7 +476,7 @@ FX_INT32 CPLST_Select::GetState(FX_INT32 nIndex) const void CPLST_Select::DeselectAll() { - for (FX_INT32 i=0,sz=m_aItems.GetSize(); i=0; i--) + for (int32_t i=m_aItems.GetSize()-1; i>=0; i--) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) { @@ -559,7 +559,7 @@ CPDF_Rect CFX_ListCtrl::OutToIn(const CPDF_Rect & rect) const void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) { - FX_INT32 nHitIndex = this->GetItemIndex(point); + int32_t nHitIndex = this->GetItemIndex(point); if (IsMultipleSel()) { @@ -608,7 +608,7 @@ void CFX_ListCtrl::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL b void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl) { - FX_INT32 nHitIndex = this->GetItemIndex(point); + int32_t nHitIndex = this->GetItemIndex(point); if (IsMultipleSel()) { @@ -639,7 +639,7 @@ void CFX_ListCtrl::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL b this->ScrollToListItem(nHitIndex); } -void CFX_ListCtrl::OnVK(FX_INT32 nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) +void CFX_ListCtrl::OnVK(int32_t nItemIndex,FX_BOOL bShift,FX_BOOL bCtrl) { if (IsMultipleSel()) { @@ -706,8 +706,8 @@ void CFX_ListCtrl::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar,FX_BOOL bShift,FX_BOOL bCtrl) { - FX_INT32 nIndex = GetLastSelected(); - FX_INT32 nFindIndex = FindNext(nIndex,nChar); + int32_t nIndex = GetLastSelected(); + int32_t nFindIndex = FindNext(nIndex,nChar); if (nFindIndex != nIndex) { @@ -728,7 +728,7 @@ void CFX_ListCtrl::SetPlateRect(const CPDF_Rect & rect) InvalidateItem(-1); } -CPDF_Rect CFX_ListCtrl::GetItemRect(FX_INT32 nIndex) const +CPDF_Rect CFX_ListCtrl::GetItemRect(int32_t nIndex) const { return InToOut(CFX_List::GetItemRect(nIndex)); } @@ -739,7 +739,7 @@ void CFX_ListCtrl::AddString(FX_LPCWSTR string) ReArrange(GetCount() - 1); } -void CFX_ListCtrl::SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected) +void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected) { if (!IsValid(nItemIndex)) return; @@ -758,7 +758,7 @@ void CFX_ListCtrl::SetMultipleSelect(FX_INT32 nItemIndex, FX_BOOL bSelected) } } -void CFX_ListCtrl::SetSingleSelect(FX_INT32 nItemIndex) +void CFX_ListCtrl::SetSingleSelect(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; @@ -776,13 +776,13 @@ void CFX_ListCtrl::SetSingleSelect(FX_INT32 nItemIndex) } } -void CFX_ListCtrl::SetCaret(FX_INT32 nItemIndex) +void CFX_ListCtrl::SetCaret(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; if (this->IsMultipleSel()) { - FX_INT32 nOldIndex = m_nCaretIndex; + int32_t nOldIndex = m_nCaretIndex; if (nOldIndex != nItemIndex) { @@ -797,7 +797,7 @@ void CFX_ListCtrl::SetCaret(FX_INT32 nItemIndex) } } -void CFX_ListCtrl::InvalidateItem(FX_INT32 nItemIndex) +void CFX_ListCtrl::InvalidateItem(int32_t nItemIndex) { if (m_pNotify) { @@ -831,10 +831,10 @@ void CFX_ListCtrl::InvalidateItem(FX_INT32 nItemIndex) void CFX_ListCtrl::SelectItems() { - for (FX_INT32 i=0,sz=m_aSelItems.GetCount(); iGetPlateRect(); CPDF_Rect rcItem = this->GetItemRect(nItemIndex); @@ -871,7 +871,7 @@ FX_BOOL CFX_ListCtrl::IsItemVisible(FX_INT32 nItemIndex) const return rcItem.bottom >= rcPlate.bottom && rcItem.top <= rcPlate.top; } -void CFX_ListCtrl::ScrollToListItem(FX_INT32 nItemIndex) +void CFX_ListCtrl::ScrollToListItem(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; @@ -960,13 +960,13 @@ CPDF_Rect CFX_ListCtrl::GetContentRect() const return InToOut(CFX_List::GetContentRect()); } -void CFX_ListCtrl::ReArrange(FX_INT32 nItemIndex) +void CFX_ListCtrl::ReArrange(int32_t nItemIndex) { CFX_List::ReArrange(nItemIndex); SetScrollInfo(); } -void CFX_ListCtrl::SetTopItem(FX_INT32 nIndex) +void CFX_ListCtrl::SetTopItem(int32_t nIndex) { if (IsValid(nIndex)) { @@ -976,9 +976,9 @@ void CFX_ListCtrl::SetTopItem(FX_INT32 nIndex) } } -FX_INT32 CFX_ListCtrl::GetTopItem() const +int32_t CFX_ListCtrl::GetTopItem() const { - FX_INT32 nItemIndex = this->GetItemIndex(this->GetBTPoint()); + int32_t nItemIndex = this->GetItemIndex(this->GetBTPoint()); if (!IsItemVisible(nItemIndex) && IsItemVisible(nItemIndex + 1)) nItemIndex += 1; @@ -997,7 +997,7 @@ void CFX_ListCtrl::Cancel() m_aSelItems.DeselectAll(); } -FX_INT32 CFX_ListCtrl::GetItemIndex(const CPDF_Point & point) const +int32_t CFX_ListCtrl::GetItemIndex(const CPDF_Point & point) const { return CFX_List::GetItemIndex(OutToIn(point)); } -- cgit v1.2.3