Chromium Code Reviews| 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/fsdk_mgr.h" | 8 #include "../include/fsdk_mgr.h" |
| 9 #include "../include/fpdf_ext.h" | 9 #include "../include/fpdf_ext.h" |
| 10 #include "../include/formfiller/FFL_FormFiller.h" | 10 #include "../include/formfiller/FFL_FormFiller.h" |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 417 CFX_ByteString csJSName; | 417 CFX_ByteString csJSName; |
| 418 CPDF_Action jsAction = docJS.GetJSAction(i, csJSName); | 418 CPDF_Action jsAction = docJS.GetJSAction(i, csJSName); |
| 419 if(m_pEnv->GetActionHander()) | 419 if(m_pEnv->GetActionHander()) |
| 420 m_pEnv->GetActionHander()->DoAction_JavaScript(jsAction, CFX_WideString::FromLocal(csJSName),this); | 420 m_pEnv->GetActionHander()->DoAction_JavaScript(jsAction, CFX_WideString::FromLocal(csJSName),this); |
| 421 } | 421 } |
| 422 | 422 |
| 423 } | 423 } |
| 424 | 424 |
| 425 FX_BOOL CPDFSDK_Document::ProcOpenAction() | 425 FX_BOOL CPDFSDK_Document::ProcOpenAction() |
| 426 { | 426 { |
| 427 » if(!m_pDoc) return FALSE; | 427 » if(!m_pDoc) |
| 428 » | 428 return FALSE; |
|
Lei Zhang
2015/03/06 00:17:05
Once again, 4-space tabs + 8 spaces do not match u
| |
| 429 » CPDF_Dictionary* pRoot = m_pDoc->GetRoot();» | 429 |
| 430 » if (!pRoot)» return FALSE; | 430 » CPDF_Dictionary* pRoot = m_pDoc->GetRoot(); |
| 431 » CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");// | 431 » if (!pRoot) |
| 432 » if(!pOpenAction) pOpenAction = pRoot->GetArray("OpenAction");// | 432 return FALSE; |
| 433 » if(!pOpenAction) return FALSE; | 433 |
| 434 » | 434 » CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction"); |
| 435 » if(!pOpenAction) | |
| 436 pOpenAction = pRoot->GetArray("OpenAction"); | |
| 437 | |
| 438 » if(!pOpenAction) | |
| 439 return FALSE; | |
| 440 | |
| 435 if(pOpenAction->GetType()==PDFOBJ_ARRAY) | 441 if(pOpenAction->GetType()==PDFOBJ_ARRAY) |
| 436 » {» | 442 return TRUE; |
| 443 | |
| 444 » if(pOpenAction->GetType()==PDFOBJ_DICTIONARY) | |
| 445 » { | |
| 446 » » CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction; | |
| 447 » » CPDF_Action action(pDict); | |
| 448 » » if(m_pEnv->GetActionHander()) | |
| 449 » » » m_pEnv->GetActionHander()->DoAction_DocOpen(action, this ); | |
| 450 return TRUE; | |
| 437 } | 451 } |
| 438 » else if(pOpenAction->GetType()==PDFOBJ_DICTIONARY) | 452 return FALSE; |
| 439 » {» | |
| 440 » » CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;» | |
| 441 » » CPDF_Action Action = pDict; | |
| 442 » » | |
| 443 » » if(m_pEnv->GetActionHander()) | |
| 444 » » » m_pEnv->GetActionHander()->DoAction_DocOpen(Action,this) ;» » | |
| 445 » }» | |
| 446 » else | |
| 447 » { | |
| 448 » » return FALSE;» » » | |
| 449 » }» | |
| 450 » return TRUE; | |
| 451 } | 453 } |
| 452 | 454 |
| 453 CPDF_OCContext* CPDFSDK_Document::GetOCContext() | 455 CPDF_OCContext* CPDFSDK_Document::GetOCContext() |
| 454 { | 456 { |
| 455 if(!m_pOccontent) | 457 if(!m_pOccontent) |
| 456 m_pOccontent = new CPDF_OCContext(m_pDoc); | 458 m_pOccontent = new CPDF_OCContext(m_pDoc); |
| 457 return m_pOccontent; | 459 return m_pOccontent; |
| 458 } | 460 } |
| 459 | 461 |
| 460 void CPDFSDK_Document::ReMovePageView(CPDF_Page* pPDFPage) | 462 void CPDFSDK_Document::ReMovePageView(CPDF_Page* pPDFPage) |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1068 | 1070 |
| 1069 for(int i=0; i<m_fxAnnotArray.GetSize(); i++) | 1071 for(int i=0; i<m_fxAnnotArray.GetSize(); i++) |
| 1070 { | 1072 { |
| 1071 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); | 1073 CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i); |
| 1072 if(pAnnot == pFocusAnnot) | 1074 if(pAnnot == pFocusAnnot) |
| 1073 return pAnnot; | 1075 return pAnnot; |
| 1074 } | 1076 } |
| 1075 return NULL; | 1077 return NULL; |
| 1076 } | 1078 } |
| 1077 | 1079 |
| OLD | NEW |