summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpdfsdk/pdfwindow/PWL_IconList.cpp36
-rw-r--r--fpdfsdk/pdfwindow/PWL_IconList.h14
2 files changed, 5 insertions, 45 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_IconList.cpp b/fpdfsdk/pdfwindow/PWL_IconList.cpp
index 951b6821f4..4928560f1c 100644
--- a/fpdfsdk/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/pdfwindow/PWL_IconList.cpp
@@ -129,8 +129,6 @@ void CPWL_IconList_Item::OnDisabled() {
CPWL_IconList_Content::CPWL_IconList_Content(int32_t nListCount)
: m_nSelectIndex(-1),
- m_pNotify(NULL),
- m_bEnableNotify(TRUE),
m_bMouseDown(FALSE),
m_nListCount(nListCount) {}
@@ -261,34 +259,18 @@ void CPWL_IconList_Content::ScrollToItem(int32_t nItemIndex) {
}
void CPWL_IconList_Content::SetSelect(int32_t nIndex) {
- if (m_nSelectIndex != nIndex) {
- SelectItem(m_nSelectIndex, FALSE);
- SelectItem(nIndex, TRUE);
- m_nSelectIndex = nIndex;
+ if (m_nSelectIndex == nIndex)
+ return;
- if (IPWL_IconList_Notify* pNotify = GetNotify())
- pNotify->OnNoteListSelChanged(nIndex);
- }
+ SelectItem(m_nSelectIndex, FALSE);
+ SelectItem(nIndex, TRUE);
+ m_nSelectIndex = nIndex;
}
int32_t CPWL_IconList_Content::GetSelect() const {
return m_nSelectIndex;
}
-IPWL_IconList_Notify* CPWL_IconList_Content::GetNotify() const {
- if (m_bEnableNotify)
- return m_pNotify;
- return NULL;
-}
-
-void CPWL_IconList_Content::SetNotify(IPWL_IconList_Notify* pNotify) {
- m_pNotify = pNotify;
-}
-
-void CPWL_IconList_Content::EnableNotify(FX_BOOL bNotify) {
- m_bEnableNotify = bNotify;
-}
-
void CPWL_IconList_Content::SelectItem(int32_t nItemIndex, FX_BOOL bSelect) {
if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) {
pItem->SetSelect(bSelect);
@@ -433,14 +415,6 @@ int32_t CPWL_IconList::GetSelect() const {
return m_pListContent->GetSelect();
}
-void CPWL_IconList::SetNotify(IPWL_IconList_Notify* pNotify) {
- m_pListContent->SetNotify(pNotify);
-}
-
-void CPWL_IconList::EnableNotify(FX_BOOL bNotify) {
- m_pListContent->EnableNotify(bNotify);
-}
-
void CPWL_IconList::SetListData(int32_t nItemIndex, void* pData) {
m_pListContent->SetListData(nItemIndex, pData);
}
diff --git a/fpdfsdk/pdfwindow/PWL_IconList.h b/fpdfsdk/pdfwindow/PWL_IconList.h
index 53648d47e0..901f4de976 100644
--- a/fpdfsdk/pdfwindow/PWL_IconList.h
+++ b/fpdfsdk/pdfwindow/PWL_IconList.h
@@ -11,18 +11,11 @@
#include "fpdfsdk/pdfwindow/PWL_ListCtrl.h"
#include "fpdfsdk/pdfwindow/PWL_Wnd.h"
-class IPWL_IconList_Notify;
class CPWL_IconList_Item;
class CPWL_IconList_Content;
class CPWL_IconList;
class CPWL_Label;
-class IPWL_IconList_Notify {
- public:
- virtual ~IPWL_IconList_Notify() {}
- virtual void OnNoteListSelChanged(int32_t nItemIndex) = 0;
-};
-
class CPWL_IconList_Item : public CPWL_Wnd {
public:
CPWL_IconList_Item();
@@ -62,14 +55,11 @@ class CPWL_IconList_Content : public CPWL_ListCtrl {
void SetSelect(int32_t nIndex);
int32_t GetSelect() const;
- void SetNotify(IPWL_IconList_Notify* pNotify);
- void EnableNotify(FX_BOOL bNotify);
void SetListData(int32_t nItemIndex, void* pData);
void SetListIcon(int32_t nItemIndex, int32_t nIconIndex);
void SetListString(int32_t nItemIndex, const CFX_WideString& str);
void SetIconFillColor(const CPWL_Color& color);
CFX_WideString GetListString(int32_t nItemIndex) const;
- IPWL_IconList_Notify* GetNotify() const;
void ScrollToItem(int32_t nItemIndex);
protected:
@@ -86,8 +76,6 @@ class CPWL_IconList_Content : public CPWL_ListCtrl {
int32_t FindItemIndex(const CFX_FloatPoint& point);
int32_t m_nSelectIndex;
- IPWL_IconList_Notify* m_pNotify;
- FX_BOOL m_bEnableNotify;
FX_BOOL m_bMouseDown;
int32_t m_nListCount;
};
@@ -100,8 +88,6 @@ class CPWL_IconList : public CPWL_Wnd {
void SetSelect(int32_t nIndex);
void SetTopItem(int32_t nIndex);
int32_t GetSelect() const;
- void SetNotify(IPWL_IconList_Notify* pNotify);
- void EnableNotify(FX_BOOL bNotify);
void SetListData(int32_t nItemIndex, void* pData);
void SetListIcon(int32_t nItemIndex, int32_t nIconIndex);
void SetListString(int32_t nItemIndex, const CFX_WideString& str);