| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 IFX_Edit_Iterator* pIterator = GetIterator(); | 66 IFX_Edit_Iterator* pIterator = GetIterator(); |
| 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_ListContainer::CFX_ListContainer() {} |
| 77 |
| 78 CFX_ListContainer::~CFX_ListContainer() {} |
| 79 |
| 80 void CFX_ListContainer::SetPlateRect(const CFX_FloatRect& rect) { |
| 81 m_rcPlate = rect; |
| 82 } |
| 83 |
| 76 CFX_List::CFX_List() | 84 CFX_List::CFX_List() |
| 77 : m_fFontSize(0.0f), m_pFontMap(nullptr), m_bMultiple(FALSE) {} | 85 : m_fFontSize(0.0f), m_pFontMap(nullptr), m_bMultiple(FALSE) {} |
| 78 | 86 |
| 79 CFX_List::~CFX_List() { | 87 CFX_List::~CFX_List() { |
| 80 Empty(); | 88 Empty(); |
| 81 } | 89 } |
| 82 | 90 |
| 83 void CFX_List::Empty() { | 91 void CFX_List::Empty() { |
| 84 for (int32_t i = 0, sz = m_aListItems.GetSize(); i < sz; i++) | 92 for (int32_t i = 0, sz = m_aListItems.GetSize(); i < sz; i++) |
| 85 delete m_aListItems.GetAt(i); | 93 delete m_aListItems.GetAt(i); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 m_ptScrollPos.x = rect.left; | 562 m_ptScrollPos.x = rect.left; |
| 555 SetScrollPos(CFX_FloatPoint(rect.left, rect.top)); | 563 SetScrollPos(CFX_FloatPoint(rect.left, rect.top)); |
| 556 ReArrange(0); | 564 ReArrange(0); |
| 557 InvalidateItem(-1); | 565 InvalidateItem(-1); |
| 558 } | 566 } |
| 559 | 567 |
| 560 CFX_FloatRect CFX_ListCtrl::GetItemRect(int32_t nIndex) const { | 568 CFX_FloatRect CFX_ListCtrl::GetItemRect(int32_t nIndex) const { |
| 561 return InToOut(CFX_List::GetItemRect(nIndex)); | 569 return InToOut(CFX_List::GetItemRect(nIndex)); |
| 562 } | 570 } |
| 563 | 571 |
| 572 int32_t CFX_ListCtrl::GetCaret() const { |
| 573 return m_nCaretIndex; |
| 574 } |
| 575 |
| 576 int32_t CFX_ListCtrl::GetSelect() const { |
| 577 return m_nSelItem; |
| 578 } |
| 579 |
| 564 void CFX_ListCtrl::AddString(const FX_WCHAR* str) { | 580 void CFX_ListCtrl::AddString(const FX_WCHAR* str) { |
| 565 AddItem(str); | 581 AddItem(str); |
| 566 ReArrange(GetCount() - 1); | 582 ReArrange(GetCount() - 1); |
| 567 } | 583 } |
| 568 | 584 |
| 569 void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected) { | 585 void CFX_ListCtrl::SetMultipleSelect(int32_t nItemIndex, FX_BOOL bSelected) { |
| 570 if (!IsValid(nItemIndex)) | 586 if (!IsValid(nItemIndex)) |
| 571 return; | 587 return; |
| 572 | 588 |
| 573 if (bSelected != IsItemSelected(nItemIndex)) { | 589 if (bSelected != IsItemSelected(nItemIndex)) { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 | 793 |
| 778 int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { | 794 int32_t CFX_ListCtrl::GetItemIndex(const CFX_FloatPoint& point) const { |
| 779 return CFX_List::GetItemIndex(OutToIn(point)); | 795 return CFX_List::GetItemIndex(OutToIn(point)); |
| 780 } | 796 } |
| 781 | 797 |
| 782 CFX_WideString CFX_ListCtrl::GetText() const { | 798 CFX_WideString CFX_ListCtrl::GetText() const { |
| 783 if (IsMultipleSel()) | 799 if (IsMultipleSel()) |
| 784 return GetItemText(m_nCaretIndex); | 800 return GetItemText(m_nCaretIndex); |
| 785 return GetItemText(m_nSelItem); | 801 return GetItemText(m_nSelItem); |
| 786 } | 802 } |
| OLD | NEW |