Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Side by Side Diff: fpdfsdk/src/fsdk_actionhandler.cpp

Issue 1473503002: Introduce "underlying types" to abstract XFA differences. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: rebase past Jun's CL. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/fpdfxfa/fpdfxfa_doc.h" 7 #include "../include/fpdfxfa/fpdfxfa_doc.h"
8 #include "fpdfsdk/include/fsdk_actionhandler.h" 8 #include "fpdfsdk/include/fsdk_actionhandler.h"
9 #include "fpdfsdk/include/fsdk_define.h" 9 #include "fpdfsdk/include/fsdk_define.h"
10 #include "fpdfsdk/include/fsdk_mgr.h" 10 #include "fpdfsdk/include/fsdk_mgr.h"
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument) { 428 FX_BOOL CPDFSDK_ActionHandler::IsValidDocView(CPDFSDK_Document* pDocument) {
429 ASSERT(pDocument); 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->GetPDFDocument();
438 ASSERT(pPDFDocument); 438 ASSERT(pPDFDocument);
439 439
440 CPDF_Dest MyDest = action.GetDest(pPDFDocument); 440 CPDF_Dest MyDest = action.GetDest(pPDFDocument);
441 int nPageIndex = MyDest.GetPageIndex(pPDFDocument); 441 int nPageIndex = MyDest.GetPageIndex(pPDFDocument);
442 int nFitType = MyDest.GetZoomMode(); 442 int nFitType = MyDest.GetZoomMode();
443 const CPDF_Array* pMyArray = ToArray(MyDest.GetObject()); 443 const CPDF_Array* pMyArray = ToArray(MyDest.GetObject());
444 float* pPosAry = nullptr; 444 float* pPosAry = nullptr;
445 int sizeOfAry = 0; 445 int sizeOfAry = 0;
446 if (pMyArray) { 446 if (pMyArray) {
447 pPosAry = new float[pMyArray->GetCount()]; 447 pPosAry = new float[pMyArray->GetCount()];
(...skipping 15 matching lines...) Expand all
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
466 void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument, 466 void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument,
467 const CPDF_Action& action) { 467 const CPDF_Action& action) {
468 ASSERT(action); 468 ASSERT(action);
469 469
470 CPDFDoc_Environment* pApp = pDocument->GetEnv(); 470 CPDFDoc_Environment* pApp = pDocument->GetEnv();
471 ASSERT(pApp != NULL); 471 ASSERT(pApp != NULL);
472 472
473 CFX_ByteString sURI = action.GetURI(pDocument->GetDocument()->GetPDFDoc()); 473 CFX_ByteString sURI = action.GetURI(pDocument->GetPDFDocument());
474 pApp->FFI_DoURIAction(sURI.c_str()); 474 pApp->FFI_DoURIAction(sURI.c_str());
475 } 475 }
476 476
477 void CPDFSDK_ActionHandler::DoAction_Named(CPDFSDK_Document* pDocument, 477 void CPDFSDK_ActionHandler::DoAction_Named(CPDFSDK_Document* pDocument,
478 const CPDF_Action& action) { 478 const CPDF_Action& action) {
479 ASSERT(action); 479 ASSERT(action);
480 480
481 CFX_ByteString csName = action.GetNamedAction(); 481 CFX_ByteString csName = action.GetNamedAction();
482 pDocument->GetEnv()->FFI_ExecuteNamedAction(csName); 482 pDocument->GetEnv()->FFI_ExecuteNamedAction(csName);
483 } 483 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698