From 7b68f616e49235267eeac8db51aadade6d60e243 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 7 Sep 2016 14:11:27 -0700 Subject: Make Observers into a templated class Review-Url: https://codereview.chromium.org/2311343003 --- fpdfsdk/include/cpdfsdk_annot.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'fpdfsdk/include') diff --git a/fpdfsdk/include/cpdfsdk_annot.h b/fpdfsdk/include/cpdfsdk_annot.h index a43b8775db..e7ae2e15a2 100644 --- a/fpdfsdk/include/cpdfsdk_annot.h +++ b/fpdfsdk/include/cpdfsdk_annot.h @@ -10,6 +10,7 @@ #include "core/fpdfdoc/include/cpdf_aaction.h" #include "core/fpdfdoc/include/cpdf_annot.h" #include "core/fpdfdoc/include/cpdf_defaultappearance.h" +#include "core/fxcrt/include/cfx_observable.h" #include "core/fxcrt/include/fx_basic.h" #include "fpdfsdk/cfx_systemhandler.h" #include "fpdfsdk/include/fsdk_common.h" @@ -21,24 +22,11 @@ class CPDF_Page; class CPDF_RenderOptions; class CPDFSDK_PageView; -class CPDFSDK_Annot { +class CPDFSDK_Annot : public CFX_Observable { public: - class Observer { - public: - explicit Observer(CPDFSDK_Annot** pWatchedPtr); - ~Observer(); - void OnAnnotDestroyed(); - - private: - CPDFSDK_Annot** m_pWatchedPtr; - }; - explicit CPDFSDK_Annot(CPDFSDK_PageView* pPageView); virtual ~CPDFSDK_Annot(); - void AddObserver(Observer* observer); - void RemoveObserver(Observer* observer); - #ifdef PDF_ENABLE_XFA virtual FX_BOOL IsXFAField(); virtual CXFA_FFWidget* GetXFAWidget() const; @@ -70,7 +58,6 @@ class CPDFSDK_Annot { void SetSelected(FX_BOOL bSelected); protected: - std::set m_Observers; CPDFSDK_PageView* m_pPageView; FX_BOOL m_bSelected; }; -- cgit v1.2.3