OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "fpdfsdk/fxedit/include/fxet_list.h" | 7 #include "fpdfsdk/fxedit/include/fxet_list.h" |
8 | 8 |
9 #include "core/fpdfdoc/include/cpvt_word.h" | 9 #include "core/fpdfdoc/include/cpvt_word.h" |
10 #include "fpdfsdk/fxedit/include/fxet_edit.h" | 10 #include "fpdfsdk/fxedit/include/fxet_edit.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 pIterator->SetAt(1); | 67 pIterator->SetAt(1); |
68 pIterator->GetWord(word); | 68 pIterator->GetWord(word); |
69 return word.Word; | 69 return word.Word; |
70 } | 70 } |
71 | 71 |
72 CFX_WideString CFX_ListItem::GetText() const { | 72 CFX_WideString CFX_ListItem::GetText() const { |
73 return m_pEdit->GetText(); | 73 return m_pEdit->GetText(); |
74 } | 74 } |
75 | 75 |
76 CFX_List::CFX_List() | 76 CFX_List::CFX_List() |
77 : m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(FALSE) {} | 77 : m_fFontSize(0.0f), m_pFontMap(nullptr), m_bMultiple(FALSE) {} |
78 | 78 |
79 CFX_List::~CFX_List() { | 79 CFX_List::~CFX_List() { |
80 Empty(); | 80 Empty(); |
81 } | 81 } |
82 | 82 |
83 void CFX_List::Empty() { | 83 void CFX_List::Empty() { |
84 for (int32_t i = 0, sz = m_aListItems.GetSize(); i < sz; i++) | 84 for (int32_t i = 0, sz = m_aListItems.GetSize(); i < sz; i++) |
85 delete m_aListItems.GetAt(i); | 85 delete m_aListItems.GetAt(i); |
86 | 86 |
87 m_aListItems.RemoveAll(); | 87 m_aListItems.RemoveAll(); |
(...skipping 30 matching lines...) Expand all Loading... |
118 } | 118 } |
119 | 119 |
120 SetContentRect(CLST_Rect(0.0f, 0.0f, 0.0f, fPosY)); | 120 SetContentRect(CLST_Rect(0.0f, 0.0f, 0.0f, fPosY)); |
121 } | 121 } |
122 | 122 |
123 IFX_Edit* CFX_List::GetItemEdit(int32_t nIndex) const { | 123 IFX_Edit* CFX_List::GetItemEdit(int32_t nIndex) const { |
124 if (CFX_ListItem* pListItem = m_aListItems.GetAt(nIndex)) { | 124 if (CFX_ListItem* pListItem = m_aListItems.GetAt(nIndex)) { |
125 return pListItem->GetEdit(); | 125 return pListItem->GetEdit(); |
126 } | 126 } |
127 | 127 |
128 return NULL; | 128 return nullptr; |
129 } | 129 } |
130 | 130 |
131 int32_t CFX_List::GetCount() const { | 131 int32_t CFX_List::GetCount() const { |
132 return m_aListItems.GetSize(); | 132 return m_aListItems.GetSize(); |
133 } | 133 } |
134 | 134 |
135 CFX_FloatRect CFX_List::GetPlateRect() const { | 135 CFX_FloatRect CFX_List::GetPlateRect() const { |
136 return CFX_ListContainer::GetPlateRect(); | 136 return CFX_ListContainer::GetPlateRect(); |
137 } | 137 } |
138 | 138 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 delete pItem; | 371 delete pItem; |
372 m_aItems.RemoveAt(i); | 372 m_aItems.RemoveAt(i); |
373 } else { | 373 } else { |
374 pItem->nState = 0; | 374 pItem->nState = 0; |
375 } | 375 } |
376 } | 376 } |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 CFX_ListCtrl::CFX_ListCtrl() | 380 CFX_ListCtrl::CFX_ListCtrl() |
381 : m_pNotify(NULL), | 381 : m_pNotify(nullptr), |
382 m_bNotifyFlag(FALSE), | 382 m_bNotifyFlag(FALSE), |
383 m_ptScrollPos(0.0f, 0.0f), | 383 m_ptScrollPos(0.0f, 0.0f), |
384 m_nSelItem(-1), | 384 m_nSelItem(-1), |
385 m_nFootIndex(-1), | 385 m_nFootIndex(-1), |
386 m_bCtrlSel(FALSE), | 386 m_bCtrlSel(FALSE), |
387 m_nCaretIndex(-1) {} | 387 m_nCaretIndex(-1) {} |
388 | 388 |
389 CFX_ListCtrl::~CFX_ListCtrl() {} | 389 CFX_ListCtrl::~CFX_ListCtrl() {} |
390 | 390 |
391 void CFX_ListCtrl::SetNotify(IFX_List_Notify* pNotify) { | 391 void CFX_ListCtrl::SetNotify(IFX_List_Notify* pNotify) { |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 | 777 |
778 int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { | 778 int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { |
779 return CFX_List::GetItemIndex(OutToIn(point)); | 779 return CFX_List::GetItemIndex(OutToIn(point)); |
780 } | 780 } |
781 | 781 |
782 CFX_WideString CFX_ListCtrl::GetText() const { | 782 CFX_WideString CFX_ListCtrl::GetText() const { |
783 if (IsMultipleSel()) | 783 if (IsMultipleSel()) |
784 return GetItemText(m_nCaretIndex); | 784 return GetItemText(m_nCaretIndex); |
785 return GetItemText(m_nSelItem); | 785 return GetItemText(m_nSelItem); |
786 } | 786 } |
OLD | NEW |