| Index: fpdfsdk/cpdfsdk_annot.cpp
|
| diff --git a/fpdfsdk/cpdfsdk_annot.cpp b/fpdfsdk/cpdfsdk_annot.cpp
|
| index 59d8f24e824440b0a4c0f9476ce4e93924bab567..54cfa1be13aef1c283fb2f783b5eeff06cc1841b 100644
|
| --- a/fpdfsdk/cpdfsdk_annot.cpp
|
| +++ b/fpdfsdk/cpdfsdk_annot.cpp
|
| @@ -9,6 +9,7 @@
|
| #include <algorithm>
|
|
|
| #include "fpdfsdk/include/fsdk_mgr.h"
|
| +#include "third_party/base/stl_util.h"
|
|
|
| #ifdef PDF_ENABLE_XFA
|
| #include "fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h"
|
| @@ -21,10 +22,25 @@ const float kMinHeight = 1.0f;
|
|
|
| } // namespace
|
|
|
| +CPDFSDK_Annot::Observer::~Observer() {}
|
| +
|
| CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView)
|
| : m_pPageView(pPageView), m_bSelected(FALSE) {}
|
|
|
| -CPDFSDK_Annot::~CPDFSDK_Annot() {}
|
| +CPDFSDK_Annot::~CPDFSDK_Annot() {
|
| + for (auto* pObserver : m_Observers)
|
| + pObserver->OnAnnotDestroyed();
|
| +}
|
| +
|
| +void CPDFSDK_Annot::AddObserver(Observer* pObserver) {
|
| + ASSERT(!pdfium::ContainsKey(m_Observers, pObserver));
|
| + m_Observers.insert(pObserver);
|
| +}
|
| +
|
| +void CPDFSDK_Annot::RemoveObserver(Observer* pObserver) {
|
| + ASSERT(pdfium::ContainsKey(m_Observers, pObserver));
|
| + m_Observers.erase(pObserver);
|
| +}
|
|
|
| #ifdef PDF_ENABLE_XFA
|
|
|
|
|