diff options
Diffstat (limited to 'fpdfsdk/src/fsdk_mgr.cpp')
-rw-r--r-- | fpdfsdk/src/fsdk_mgr.cpp | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index efb21a7efc..9e0b230439 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -424,30 +424,32 @@ void CPDFSDK_Document:: ProcJavascriptFun() FX_BOOL CPDFSDK_Document::ProcOpenAction() { - if(!m_pDoc) return FALSE; - - CPDF_Dictionary* pRoot = m_pDoc->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->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() |