| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
| 8 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 8 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
| 9 #include "../include/fpdfxfa/fpdfxfa_page.h" | 9 #include "../include/fpdfxfa/fpdfxfa_page.h" |
| 10 #include "../include/fpdfxfa/fpdfxfa_util.h" | 10 #include "../include/fpdfxfa/fpdfxfa_util.h" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 CFX_ByteString csJSName; | 420 CFX_ByteString csJSName; |
| 421 CPDF_Action jsAction = docJS.GetJSAction(i, csJSName); | 421 CPDF_Action jsAction = docJS.GetJSAction(i, csJSName); |
| 422 if(m_pEnv->GetActionHander()) | 422 if(m_pEnv->GetActionHander()) |
| 423 m_pEnv->GetActionHander()->DoAction_JavaScript(jsAction,
CFX_WideString::FromLocal(csJSName),this); | 423 m_pEnv->GetActionHander()->DoAction_JavaScript(jsAction,
CFX_WideString::FromLocal(csJSName),this); |
| 424 } | 424 } |
| 425 | 425 |
| 426 } | 426 } |
| 427 | 427 |
| 428 FX_BOOL CPDFSDK_Document::ProcOpenAction() | 428 FX_BOOL CPDFSDK_Document::ProcOpenAction() |
| 429 { | 429 { |
| 430 » if(!m_pDoc) return FALSE; | 430 » if(!m_pDoc) |
| 431 » | 431 » » return FALSE; |
| 432 » CPDF_Dictionary* pRoot = m_pDoc->GetPDFDoc()->GetRoot();» | 432 |
| 433 » if (!pRoot)» return FALSE; | 433 » CPDF_Dictionary* pRoot = m_pDoc->GetPDFDoc()->GetRoot(); |
| 434 » CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");// | 434 » if (!pRoot) |
| 435 » if(!pOpenAction) pOpenAction = pRoot->GetArray("OpenAction");// | 435 » » return FALSE; |
| 436 » if(!pOpenAction) return FALSE; | 436 |
| 437 » | 437 » CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction"); |
| 438 » if(!pOpenAction) |
| 439 » » pOpenAction = pRoot->GetArray("OpenAction"); |
| 440 |
| 441 » if(!pOpenAction) |
| 442 » » return FALSE; |
| 443 |
| 438 if(pOpenAction->GetType()==PDFOBJ_ARRAY) | 444 if(pOpenAction->GetType()==PDFOBJ_ARRAY) |
| 439 » {» | 445 » » return TRUE; |
| 446 |
| 447 » if(pOpenAction->GetType()==PDFOBJ_DICTIONARY) |
| 448 » { |
| 449 » » CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction; |
| 450 » » CPDF_Action action(pDict); |
| 451 » » if(m_pEnv->GetActionHander()) |
| 452 » » » m_pEnv->GetActionHander()->DoAction_DocOpen(action, this
); |
| 453 » » return TRUE; |
| 440 } | 454 } |
| 441 » else if(pOpenAction->GetType()==PDFOBJ_DICTIONARY) | 455 » return FALSE; |
| 442 » {» | |
| 443 » » CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;» | |
| 444 » » CPDF_Action Action = pDict; | |
| 445 » » | |
| 446 » » if(m_pEnv->GetActionHander()) | |
| 447 » » » m_pEnv->GetActionHander()->DoAction_DocOpen(Action,this)
;» » | |
| 448 » }» | |
| 449 » else | |
| 450 » { | |
| 451 » » return FALSE;» » » | |
| 452 » }» | |
| 453 » return TRUE; | |
| 454 } | 456 } |
| 455 | 457 |
| 456 CPDF_OCContext* CPDFSDK_Document::GetOCContext() | 458 CPDF_OCContext* CPDFSDK_Document::GetOCContext() |
| 457 { | 459 { |
| 458 if(!m_pOccontent) | 460 if(!m_pOccontent) |
| 459 m_pOccontent = new CPDF_OCContext(m_pDoc->GetPDFDoc()); | 461 m_pOccontent = new CPDF_OCContext(m_pDoc->GetPDFDoc()); |
| 460 return m_pOccontent; | 462 return m_pOccontent; |
| 461 } | 463 } |
| 462 | 464 |
| 463 void CPDFSDK_Document::ReMovePageView(CPDFXFA_Page* pPDFXFAPage) | 465 void CPDFSDK_Document::ReMovePageView(CPDFXFA_Page* pPDFXFAPage) |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1249 | 1251 |
| 1250 for(int i=0; i<m_fxAnnotArray.GetSize(); i++) | 1252 for(int i=0; i<m_fxAnnotArray.GetSize(); i++) |
| 1251 { | 1253 { |
| 1252 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); | 1254 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); |
| 1253 if(pAnnot == pFocusAnnot) | 1255 if(pAnnot == pFocusAnnot) |
| 1254 return pAnnot; | 1256 return pAnnot; |
| 1255 } | 1257 } |
| 1256 return NULL; | 1258 return NULL; |
| 1257 } | 1259 } |
| 1258 | 1260 |
| OLD | NEW |