summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_docjsactions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfdoc/cpdf_docjsactions.cpp')
-rw-r--r--core/fpdfdoc/cpdf_docjsactions.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_docjsactions.cpp b/core/fpdfdoc/cpdf_docjsactions.cpp
index c0e7a78fd6..59dbccce85 100644
--- a/core/fpdfdoc/cpdf_docjsactions.cpp
+++ b/core/fpdfdoc/cpdf_docjsactions.cpp
@@ -10,9 +10,11 @@
CPDF_DocJSActions::CPDF_DocJSActions(CPDF_Document* pDoc) : m_pDocument(pDoc) {}
+CPDF_DocJSActions::~CPDF_DocJSActions() {}
+
int CPDF_DocJSActions::CountJSActions() const {
ASSERT(m_pDocument);
- CPDF_NameTree name_tree(m_pDocument, "JavaScript");
+ CPDF_NameTree name_tree(m_pDocument.Get(), "JavaScript");
return name_tree.GetCount();
}
@@ -20,7 +22,7 @@ CPDF_Action CPDF_DocJSActions::GetJSActionAndName(
int index,
CFX_ByteString* csName) const {
ASSERT(m_pDocument);
- CPDF_NameTree name_tree(m_pDocument, "JavaScript");
+ CPDF_NameTree name_tree(m_pDocument.Get(), "JavaScript");
CPDF_Object* pAction = name_tree.LookupValueAndName(index, csName);
return ToDictionary(pAction) ? CPDF_Action(pAction->GetDict())
: CPDF_Action();
@@ -28,7 +30,7 @@ CPDF_Action CPDF_DocJSActions::GetJSActionAndName(
CPDF_Action CPDF_DocJSActions::GetJSAction(const CFX_ByteString& csName) const {
ASSERT(m_pDocument);
- CPDF_NameTree name_tree(m_pDocument, "JavaScript");
+ CPDF_NameTree name_tree(m_pDocument.Get(), "JavaScript");
CPDF_Object* pAction = name_tree.LookupValue(csName);
return ToDictionary(pAction) ? CPDF_Action(pAction->GetDict())
: CPDF_Action();
@@ -36,6 +38,6 @@ CPDF_Action CPDF_DocJSActions::GetJSAction(const CFX_ByteString& csName) const {
int CPDF_DocJSActions::FindJSAction(const CFX_ByteString& csName) const {
ASSERT(m_pDocument);
- CPDF_NameTree name_tree(m_pDocument, "JavaScript");
+ CPDF_NameTree name_tree(m_pDocument.Get(), "JavaScript");
return name_tree.GetIndex(csName);
}