summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_mgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/src/fsdk_mgr.cpp46
1 files changed, 24 insertions, 22 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp
index f134b790a9..7b071a9b55 100644
--- a/fpdfsdk/src/fsdk_mgr.cpp
+++ b/fpdfsdk/src/fsdk_mgr.cpp
@@ -427,30 +427,32 @@ void CPDFSDK_Document:: ProcJavascriptFun()
FX_BOOL CPDFSDK_Document::ProcOpenAction()
{
- if(!m_pDoc) return FALSE;
-
- CPDF_Dictionary* pRoot = m_pDoc->GetPDFDoc()->GetRoot();
- if (!pRoot) return FALSE;
- CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");//
- if(!pOpenAction) pOpenAction = pRoot->GetArray("OpenAction");//
- if(!pOpenAction) return FALSE;
-
+ if(!m_pDoc)
+ return FALSE;
+
+ CPDF_Dictionary* pRoot = m_pDoc->GetPDFDoc()->GetRoot();
+ if (!pRoot)
+ return FALSE;
+
+ CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");
+ if(!pOpenAction)
+ pOpenAction = pRoot->GetArray("OpenAction");
+
+ if(!pOpenAction)
+ return FALSE;
+
if(pOpenAction->GetType()==PDFOBJ_ARRAY)
- {
- }
- else if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
- {
- CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;
- CPDF_Action Action = pDict;
-
- if(m_pEnv->GetActionHander())
- m_pEnv->GetActionHander()->DoAction_DocOpen(Action,this);
- }
- else
+ return TRUE;
+
+ if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
{
- return FALSE;
- }
- return TRUE;
+ CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;
+ CPDF_Action action(pDict);
+ if(m_pEnv->GetActionHander())
+ m_pEnv->GetActionHander()->DoAction_DocOpen(action, this);
+ return TRUE;
+ }
+ return FALSE;
}
CPDF_OCContext* CPDFSDK_Document::GetOCContext()