diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-09 13:24:12 -0700 |
commit | bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (patch) | |
tree | 4cfbe682869d89900f33751c37f6a84865beeb0a /fpdfsdk/src/fxedit/fxet_list.cpp | |
parent | b116136da234afcad018bb44a3ccb64b9ad2a554 (diff) | |
download | pdfium-bfa9a824a20f37c2dd7111012b46c929cf2ed8a0.tar.xz |
Merge to XFA: Use stdint.h types throughout PDFium.
Near-automatic merge, plus re-running scripts to update
additional usage.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1172793002
Diffstat (limited to 'fpdfsdk/src/fxedit/fxet_list.cpp')
-rw-r--r-- | fpdfsdk/src/fxedit/fxet_list.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
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(); i<sz; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) delete m_aListItems.GetAt(i); m_aListItems.RemoveAll(); @@ -157,14 +157,14 @@ void CFX_List::AddItem(FX_LPCWSTR str) } } -void CFX_List::ReArrange(FX_INT32 nItemIndex) +void CFX_List::ReArrange(int32_t nItemIndex) { FX_FLOAT fPosY = 0.0f; if (CFX_ListItem * pPrevItem = m_aListItems.GetAt(nItemIndex - 1)) fPosY = pPrevItem->GetRect().bottom; - for (FX_INT32 i=nItemIndex,sz=m_aListItems.GetSize(); i<sz; i++) + for (int32_t i=nItemIndex,sz=m_aListItems.GetSize(); i<sz; i++) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -177,7 +177,7 @@ void CFX_List::ReArrange(FX_INT32 nItemIndex) SetContentRect(CLST_Rect(0.0f,0.0f,0.0f,fPosY)); } -IFX_Edit * CFX_List::GetItemEdit(FX_INT32 nIndex) const +IFX_Edit * CFX_List::GetItemEdit(int32_t nIndex) const { if (CFX_ListItem * pListItem = m_aListItems.GetAt(nIndex)) { @@ -187,7 +187,7 @@ IFX_Edit * CFX_List::GetItemEdit(FX_INT32 nIndex) const return NULL; } -FX_INT32 CFX_List::GetCount() const +int32_t CFX_List::GetCount() const { return m_aListItems.GetSize(); } @@ -207,14 +207,14 @@ FX_FLOAT CFX_List::GetFontSize() const return m_fFontSize; } -FX_INT32 CFX_List::GetItemIndex(const CPDF_Point & point) const +int32_t CFX_List::GetItemIndex(const CPDF_Point & point) const { CPDF_Point pt = OuterToInner(point); FX_BOOL bFirst = TRUE; FX_BOOL bLast = TRUE; - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -253,9 +253,9 @@ FX_FLOAT CFX_List::GetFirstHeight() const return 1.0f; } -FX_INT32 CFX_List::GetFirstSelected() const +int32_t CFX_List::GetFirstSelected() const { - for (FX_INT32 i=0,sz=m_aListItems.GetSize(); i<sz; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) { if (CFX_ListItem * pListItem = m_aListItems.GetAt(i)) { @@ -266,9 +266,9 @@ FX_INT32 CFX_List::GetFirstSelected() const return -1; } -FX_INT32 CFX_List::GetLastSelected() const +int32_t CFX_List::GetLastSelected() const { - for (FX_INT32 i=m_aListItems.GetSize()-1; 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; i++) + for (int32_t i=0,sz=m_aListItems.GetSize(); i<sz; i++) { nCircleIndex ++; if (nCircleIndex >= 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<sz; i++) + for (int32_t i=0,sz=m_aItems.GetSize(); i<sz; i++) delete m_aItems.GetAt(i); m_aItems.RemoveAll(); } -void CPLST_Select::Add(FX_INT32 nItemIndex) +void CPLST_Select::Add(int32_t nItemIndex) { - FX_INT32 nIndex = Find(nItemIndex); + int32_t nIndex = Find(nItemIndex); if (nIndex < 0) m_aItems.Add(new CPLST_Select_Item(nItemIndex,1)); @@ -398,21 +398,21 @@ void CPLST_Select::Add(FX_INT32 nItemIndex) } } -void CPLST_Select::Add(FX_INT32 nBeginIndex, FX_INT32 nEndIndex) +void CPLST_Select::Add(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++) 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<sz; i++) + for (int32_t i=0,sz=m_aItems.GetSize(); i<sz; i++) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) { @@ -446,17 +446,17 @@ FX_INT32 CPLST_Select::Find(FX_INT32 nItemIndex) const return -1; } -FX_BOOL CPLST_Select::IsExist(FX_INT32 nItemIndex) const +FX_BOOL CPLST_Select::IsExist(int32_t nItemIndex) const { return Find(nItemIndex) >= 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<sz; i++) + for (int32_t i=0,sz=m_aItems.GetSize(); i<sz; i++) { if (CPLST_Select_Item * pItem = m_aItems.GetAt(i)) { @@ -487,7 +487,7 @@ void CPLST_Select::DeselectAll() void CPLST_Select::Done() { - 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)) { @@ -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(); i<sz; i++) + for (int32_t i=0,sz=m_aSelItems.GetCount(); i<sz; i++) { - FX_INT32 nItemIndex = m_aSelItems.GetItemIndex(i); - FX_INT32 nState = m_aSelItems.GetState(i); + int32_t nItemIndex = m_aSelItems.GetItemIndex(i); + int32_t nState = m_aSelItems.GetState(i); switch(nState) { @@ -850,7 +850,7 @@ void CFX_ListCtrl::SelectItems() m_aSelItems.Done(); } -void CFX_ListCtrl::Select(FX_INT32 nItemIndex) +void CFX_ListCtrl::Select(int32_t nItemIndex) { if (!IsValid(nItemIndex)) return; @@ -863,7 +863,7 @@ void CFX_ListCtrl::Select(FX_INT32 nItemIndex) SetSingleSelect(nItemIndex); } -FX_BOOL CFX_ListCtrl::IsItemVisible(FX_INT32 nItemIndex) const +FX_BOOL CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const { CPDF_Rect rcPlate = this->GetPlateRect(); 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)); } |