Stop nesting ObservedPtr inside Observable.
Now, only the ObservedPtr<> is templated, and a templated
Observable isn't required. Templated Observable<> lead to
templated Obeservable<>::ObserverIface, which made usage of
ObservedPtr<> to subclasses awkward, since the ObserverIfaces
weren't subclasses of each other even if the dependent types
were.
The majority of the change is to fix syntax now that
we no longer have a typename in the classes derived from
Observable.
- Rename Observable::Observer to ObserverIface for clarity.
Change-Id: I59f70915f0a87fa2269d051acff5a7206a3e79e8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/55951
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/cpdfsdk_formfillenvironment.cpp b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
index 0cb8f64..e6221ac 100644
--- a/fpdfsdk/cpdfsdk_formfillenvironment.cpp
+++ b/fpdfsdk/cpdfsdk_formfillenvironment.cpp
@@ -647,7 +647,7 @@
}
bool CPDFSDK_FormFillEnvironment::SetFocusAnnot(
- CPDFSDK_Annot::ObservedPtr* pAnnot) {
+ ObservedPtr<CPDFSDK_Annot>* pAnnot) {
if (m_bBeingDestroyed)
return false;
if (m_pFocusAnnot == *pAnnot)
@@ -666,7 +666,7 @@
return false;
#ifdef PDF_ENABLE_XFA
- CPDFSDK_Annot::ObservedPtr pLastFocusAnnot(m_pFocusAnnot.Get());
+ ObservedPtr<CPDFSDK_Annot> pLastFocusAnnot(m_pFocusAnnot.Get());
if (!pAnnotHandler->Annot_OnChangeFocus(pAnnot, &pLastFocusAnnot))
return false;
#endif // PDF_ENABLE_XFA
@@ -684,11 +684,11 @@
return false;
CPDFSDK_AnnotHandlerMgr* pAnnotHandler = GetAnnotHandlerMgr();
- CPDFSDK_Annot::ObservedPtr pFocusAnnot(m_pFocusAnnot.Get());
+ ObservedPtr<CPDFSDK_Annot> pFocusAnnot(m_pFocusAnnot.Get());
m_pFocusAnnot.Reset();
#ifdef PDF_ENABLE_XFA
- CPDFSDK_Annot::ObservedPtr pNull;
+ ObservedPtr<CPDFSDK_Annot> pNull;
if (!pAnnotHandler->Annot_OnChangeFocus(&pNull, &pFocusAnnot))
return false;
#endif // PDF_ENABLE_XFA