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

Side by Side Diff: fpdfsdk/src/fpdfformfill.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 "public/fpdf_formfill.h" 7 #include "public/fpdf_formfill.h"
8 8
9 #include "../include/fpdfxfa/fpdfxfa_app.h" 9 #include "../include/fpdfxfa/fpdfxfa_app.h"
10 #include "../include/fpdfxfa/fpdfxfa_doc.h" 10 #include "../include/fpdfxfa/fpdfxfa_doc.h"
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 return; 604 return;
605 605
606 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument(); 606 CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
607 if (!pSDKDoc) 607 if (!pSDKDoc)
608 return; 608 return;
609 609
610 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; 610 CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
611 CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE); 611 CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
612 if (pPageView) { 612 if (pPageView) {
613 pPageView->SetValid(FALSE); 613 pPageView->SetValid(FALSE);
614 // ReMovePageView() takes care of the delete for us. 614 // RemovePageView() takes care of the delete for us.
615 pSDKDoc->ReMovePageView(pPage); 615 pSDKDoc->RemovePageView(pPage);
616 } 616 }
617 } 617 }
618 618
619 DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle) { 619 DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle) {
620 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); 620 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle);
621 if (pSDKDoc && ((CPDFDoc_Environment*)hHandle)->IsJSInitiated()) 621 if (pSDKDoc && ((CPDFDoc_Environment*)hHandle)->IsJSInitiated())
622 pSDKDoc->ProcJavascriptFun(); 622 pSDKDoc->ProcJavascriptFun();
623 } 623 }
624 624
625 DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle) { 625 DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle) {
626 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); 626 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle);
627 if (pSDKDoc && ((CPDFDoc_Environment*)hHandle)->IsJSInitiated()) 627 if (pSDKDoc && ((CPDFDoc_Environment*)hHandle)->IsJSInitiated())
628 pSDKDoc->ProcOpenAction(); 628 pSDKDoc->ProcOpenAction();
629 } 629 }
630 630
631 DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, 631 DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle,
632 int aaType) { 632 int aaType) {
633 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle); 633 CPDFSDK_Document* pSDKDoc = FormHandleToSDKDoc(hHandle);
634 if (!pSDKDoc) 634 if (!pSDKDoc)
635 return; 635 return;
636 636
637 CPDF_Document* pDoc = pSDKDoc->GetDocument()->GetPDFDoc(); 637 CPDF_Document* pDoc = pSDKDoc->GetPDFDocument();
638 CPDF_Dictionary* pDic = pDoc->GetRoot(); 638 CPDF_Dictionary* pDic = pDoc->GetRoot();
639 if (!pDic) 639 if (!pDic)
640 return; 640 return;
641 641
642 CPDF_AAction aa = pDic->GetDict(FX_BSTRC("AA")); 642 CPDF_AAction aa = pDic->GetDict(FX_BSTRC("AA"));
643 if (aa.ActionExist((CPDF_AAction::AActionType)aaType)) { 643 if (aa.ActionExist((CPDF_AAction::AActionType)aaType)) {
644 CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType); 644 CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType);
645 CPDFSDK_ActionHandler* pActionHandler = 645 CPDFSDK_ActionHandler* pActionHandler =
646 ((CPDFDoc_Environment*)hHandle)->GetActionHander(); 646 ((CPDFDoc_Environment*)hHandle)->GetActionHander();
647 ASSERT(pActionHandler != NULL); 647 ASSERT(pActionHandler != NULL);
(...skipping 23 matching lines...) Expand all
671 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc); 671 pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
672 } 672 }
673 } else { 673 } else {
674 if (aa.ActionExist(CPDF_AAction::ClosePage)) { 674 if (aa.ActionExist(CPDF_AAction::ClosePage)) {
675 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage); 675 CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
676 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc); 676 pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
677 } 677 }
678 } 678 }
679 } 679 }
680 } 680 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698