summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Annot.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-12 09:47:52 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-12 09:47:52 -0700
commit1c62054a42cf0759148501a36c541de5d5769d32 (patch)
treeed2e53f26474dff1149ce83d3f175c3c36b31631 /fpdfsdk/javascript/Annot.cpp
parent75f84a56fed36111ece82d0ac96e87289622b093 (diff)
downloadpdfium-1c62054a42cf0759148501a36c541de5d5769d32.tar.xz
Make CFX_Obeservable::Observer into a pointer-ish type;
This may be a better design because it avoids having a level of indirection that the Observer required. Review-Url: https://codereview.chromium.org/2326763002
Diffstat (limited to 'fpdfsdk/javascript/Annot.cpp')
-rw-r--r--fpdfsdk/javascript/Annot.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/fpdfsdk/javascript/Annot.cpp b/fpdfsdk/javascript/Annot.cpp
index ec77000449..8e6a775dcd 100644
--- a/fpdfsdk/javascript/Annot.cpp
+++ b/fpdfsdk/javascript/Annot.cpp
@@ -40,7 +40,7 @@ Annot::~Annot() {}
FX_BOOL Annot::hidden(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
- CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot);
+ CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot.Get());
if (!baAnnot)
return FALSE;
@@ -72,7 +72,7 @@ FX_BOOL Annot::hidden(IJS_Context* cc,
FX_BOOL Annot::name(IJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
- CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot);
+ CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot.Get());
if (!baAnnot)
return FALSE;
@@ -95,7 +95,7 @@ FX_BOOL Annot::type(IJS_Context* cc,
return FALSE;
}
- CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot);
+ CPDFSDK_BAAnnot* baAnnot = ToBAAnnot(m_pAnnot.Get());
if (!baAnnot)
return FALSE;
@@ -104,6 +104,5 @@ FX_BOOL Annot::type(IJS_Context* cc,
}
void Annot::SetSDKAnnot(CPDFSDK_BAAnnot* annot) {
- m_pAnnot = annot;
- SetWatchedPtr(&m_pAnnot);
+ m_pAnnot.Reset(annot);
}