| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "xfa/fwl/core/ifwl_combolist.h" | 7 #include "xfa/fwl/core/ifwl_combolist.h" |
| 8 | 8 |
| 9 #include "xfa/fwl/core/ifwl_combobox.h" | 9 #include "xfa/fwl/core/ifwl_combobox.h" |
| 10 #include "xfa/fwl/core/ifwl_comboedit.h" | 10 #include "xfa/fwl/core/ifwl_comboedit.h" |
| 11 | 11 |
| 12 IFWL_ComboList::IFWL_ComboList(const CFWL_WidgetImpProperties& properties, | 12 IFWL_ComboList::IFWL_ComboList(const CFWL_WidgetImpProperties& properties, |
| 13 IFWL_Widget* pOuter) | 13 IFWL_Widget* pOuter) |
| 14 : IFWL_ListBox(properties, pOuter), m_bNotifyOwner(TRUE) { | 14 : IFWL_ListBox(properties, pOuter), m_bNotifyOwner(TRUE) { |
| 15 ASSERT(pOuter); | 15 ASSERT(pOuter); |
| 16 } | 16 } |
| 17 | 17 |
| 18 FWL_Error IFWL_ComboList::Initialize() { | 18 FWL_Error IFWL_ComboList::Initialize() { |
| 19 if (IFWL_ListBox::Initialize() != FWL_Error::Succeeded) | 19 if (IFWL_ListBox::Initialize() != FWL_Error::Succeeded) |
| 20 return FWL_Error::Indefinite; | 20 return FWL_Error::Indefinite; |
| 21 delete m_pDelegate; | 21 delete m_pDelegate; |
| 22 m_pDelegate = new CFWL_ComboListImpDelegate(this); | 22 m_pDelegate = new CFWL_ComboListImpDelegate(this); |
| 23 return FWL_Error::Succeeded; | 23 return FWL_Error::Succeeded; |
| 24 } | 24 } |
| 25 | 25 |
| 26 FWL_Error IFWL_ComboList::Finalize() { | 26 void IFWL_ComboList::Finalize() { |
| 27 delete m_pDelegate; | 27 delete m_pDelegate; |
| 28 m_pDelegate = nullptr; | 28 m_pDelegate = nullptr; |
| 29 return IFWL_ListBox::Finalize(); | 29 IFWL_ListBox::Finalize(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 int32_t IFWL_ComboList::MatchItem(const CFX_WideString& wsMatch) { | 32 int32_t IFWL_ComboList::MatchItem(const CFX_WideString& wsMatch) { |
| 33 if (wsMatch.IsEmpty()) { | 33 if (wsMatch.IsEmpty()) { |
| 34 return -1; | 34 return -1; |
| 35 } | 35 } |
| 36 if (!m_pProperties->m_pDataProvider) | 36 if (!m_pProperties->m_pDataProvider) |
| 37 return -1; | 37 return -1; |
| 38 IFWL_ListBoxDP* pData = | 38 IFWL_ListBoxDP* pData = |
| 39 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); | 39 static_cast<IFWL_ListBoxDP*>(m_pProperties->m_pDataProvider); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 CFX_RectF rtInvalidate; | 282 CFX_RectF rtInvalidate; |
| 283 rtInvalidate.Set(0, 0, m_pOwner->m_pProperties->m_rtWidget.width, | 283 rtInvalidate.Set(0, 0, m_pOwner->m_pProperties->m_rtWidget.width, |
| 284 m_pOwner->m_pProperties->m_rtWidget.height); | 284 m_pOwner->m_pProperties->m_rtWidget.height); |
| 285 m_pOwner->Repaint(&rtInvalidate); | 285 m_pOwner->Repaint(&rtInvalidate); |
| 286 break; | 286 break; |
| 287 } | 287 } |
| 288 default: | 288 default: |
| 289 break; | 289 break; |
| 290 } | 290 } |
| 291 } | 291 } |
| OLD | NEW |