diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-03-05 16:44:22 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-03-05 16:44:22 -0800 |
commit | 7b5bc26e8267fec38bef9f95cd04d2bd731faff3 (patch) | |
tree | 9203aa0ff0d4a34616a5161b2ded34ce7e9ada24 /fpdfsdk/src/fsdk_mgr.cpp | |
parent | 827a1722f70e7092270b5e0fdfba1e9c0b1ac50f (diff) | |
download | pdfium-7b5bc26e8267fec38bef9f95cd04d2bd731faff3.tar.xz |
Merge to XFA: Make conversion between CPDF_Action and its dictionary explicit.
Original Review URL: https://codereview.chromium.org/984773002
R=thestig@chromium.org
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/984783002
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 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() |