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/fsdk_mgr.h" | 9 #include "../include/fsdk_mgr.h" |
10 #include "../include/fsdk_actionhandler.h" | 10 #include "../include/fsdk_actionhandler.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
419 case CPDF_Action::Trans: | 419 case CPDF_Action::Trans: |
420 break; | 420 break; |
421 case CPDF_Action::GoTo3DView: | 421 case CPDF_Action::GoTo3DView: |
422 break; | 422 break; |
423 default: | 423 default: |
424 break; | 424 break; |
425 } | 425 } |
426 } | 426 } |
427 | 427 |
428 FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument) { | 428 FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument) { |
429 ASSERT(pDocument != NULL); | 429 ASSERT(pDocument); |
430 return TRUE; | 430 return TRUE; |
431 } | 431 } |
432 | 432 |
433 void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument, | 433 void CPDFSDK_ActionHandler::DoAction_GoTo(CPDFSDK_Document* pDocument, |
434 const CPDF_Action& action) { | 434 const CPDF_Action& action) { |
435 ASSERT(action); | 435 ASSERT(action); |
436 | 436 |
437 CPDF_Document* pPDFDocument = pDocument->GetDocument()->GetPDFDoc(); | 437 CPDF_Document* pPDFDocument = pDocument->GetDocument()->GetPDFDoc(); |
dsinclair
2015/10/22 13:39:29
Merge conflict:
master branch: pDocument->GetDocu
| |
438 ASSERT(pPDFDocument != NULL); | 438 ASSERT(pPDFDocument); |
439 CPDFDoc_Environment* pApp = pDocument->GetEnv(); | |
440 ASSERT(pApp != NULL); | |
441 | 439 |
442 CPDF_Dest MyDest = action.GetDest(pPDFDocument); | 440 CPDF_Dest MyDest = action.GetDest(pPDFDocument); |
443 int nPageIndex = MyDest.GetPageIndex(pPDFDocument); | 441 int nPageIndex = MyDest.GetPageIndex(pPDFDocument); |
444 int nFitType = MyDest.GetZoomMode(); | 442 int nFitType = MyDest.GetZoomMode(); |
445 const CPDF_Array* pMyArray = (CPDF_Array*)MyDest.GetObject(); | 443 const CPDF_Array* pMyArray = ToArray(MyDest.GetObject()); |
446 float* pPosAry = NULL; | 444 float* pPosAry = nullptr; |
447 int sizeOfAry = 0; | 445 int sizeOfAry = 0; |
448 if (pMyArray != NULL) { | 446 if (pMyArray) { |
449 pPosAry = new float[pMyArray->GetCount()]; | 447 pPosAry = new float[pMyArray->GetCount()]; |
450 int j = 0; | 448 int j = 0; |
451 for (int i = 2; i < (int)pMyArray->GetCount(); i++) { | 449 for (int i = 2; i < (int)pMyArray->GetCount(); i++) { |
452 pPosAry[j++] = pMyArray->GetFloat(i); | 450 pPosAry[j++] = pMyArray->GetFloat(i); |
453 } | 451 } |
454 sizeOfAry = j; | 452 sizeOfAry = j; |
455 } | 453 } |
454 | |
455 CPDFDoc_Environment* pApp = pDocument->GetEnv(); | |
456 pApp->FFI_DoGoToAction(nPageIndex, nFitType, pPosAry, sizeOfAry); | 456 pApp->FFI_DoGoToAction(nPageIndex, nFitType, pPosAry, sizeOfAry); |
457 delete[] pPosAry; | 457 delete[] pPosAry; |
458 } | 458 } |
459 | 459 |
460 void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument, | 460 void CPDFSDK_ActionHandler::DoAction_GoToR(CPDFSDK_Document* pDocument, |
461 const CPDF_Action& action) {} | 461 const CPDF_Action& action) {} |
462 | 462 |
463 void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument, | 463 void CPDFSDK_ActionHandler::DoAction_Launch(CPDFSDK_Document* pDocument, |
464 const CPDF_Action& action) {} | 464 const CPDF_Action& action) {} |
465 | 465 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
679 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); | 679 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm(); |
680 ASSERT(pInterForm != NULL); | 680 ASSERT(pInterForm != NULL); |
681 | 681 |
682 if (pInterForm->DoAction_ImportData(action)) { | 682 if (pInterForm->DoAction_ImportData(action)) { |
683 pDocument->SetChangeMark(); | 683 pDocument->SetChangeMark(); |
684 return TRUE; | 684 return TRUE; |
685 } | 685 } |
686 | 686 |
687 return FALSE; | 687 return FALSE; |
688 } | 688 } |
OLD | NEW |