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

Side by Side Diff: fpdfsdk/formfiller/cffl_iformfiller.cpp

Issue 1835693002: Remove FX_DWORD from fpdfsdk/ and testing/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « fpdfsdk/formfiller/cffl_iformfiller.h ('k') | fpdfsdk/formfiller/cffl_listbox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "fpdfsdk/formfiller/cffl_iformfiller.h" 7 #include "fpdfsdk/formfiller/cffl_iformfiller.h"
8 8
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 pPDFAnnot->GetRect(rcAnnot); 50 pPDFAnnot->GetRect(rcAnnot);
51 51
52 CFX_FloatRect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1); 52 CFX_FloatRect rcWin = CPWL_Utils::InflateRect(rcAnnot, 1);
53 return rcWin.GetOutterRect(); 53 return rcWin.GetOutterRect();
54 } 54 }
55 55
56 void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, 56 void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView,
57 CPDFSDK_Annot* pAnnot, 57 CPDFSDK_Annot* pAnnot,
58 CFX_RenderDevice* pDevice, 58 CFX_RenderDevice* pDevice,
59 CFX_Matrix* pUser2Device, 59 CFX_Matrix* pUser2Device,
60 FX_DWORD dwFlags) { 60 uint32_t dwFlags) {
61 ASSERT(pPageView); 61 ASSERT(pPageView);
62 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; 62 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
63 63
64 if (IsVisible(pWidget)) { 64 if (IsVisible(pWidget)) {
65 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { 65 if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) {
66 if (pFormFiller->IsValid()) { 66 if (pFormFiller->IsValid()) {
67 pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); 67 pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags);
68 pAnnot->GetPDFPage(); 68 pAnnot->GetPDFPage();
69 69
70 CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument(); 70 CPDFSDK_Document* pDocument = m_pApp->GetSDKDocument();
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 int nFieldFlags = pWidget->GetFieldFlags(); 493 int nFieldFlags = pWidget->GetFieldFlags();
494 return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY; 494 return (nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY;
495 } 495 }
496 496
497 FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) { 497 FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) {
498 if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON) 498 if (pWidget->GetFieldType() == FIELDTYPE_PUSHBUTTON)
499 return TRUE; 499 return TRUE;
500 500
501 CPDF_Page* pPage = pWidget->GetPDFPage(); 501 CPDF_Page* pPage = pWidget->GetPDFPage();
502 CPDF_Document* pDocument = pPage->m_pDocument; 502 CPDF_Document* pDocument = pPage->m_pDocument;
503 FX_DWORD dwPermissions = pDocument->GetUserPermissions(); 503 uint32_t dwPermissions = pDocument->GetUserPermissions();
504 return (dwPermissions & FPDFPERM_FILL_FORM) || 504 return (dwPermissions & FPDFPERM_FILL_FORM) ||
505 (dwPermissions & FPDFPERM_ANNOT_FORM) || 505 (dwPermissions & FPDFPERM_ANNOT_FORM) ||
506 (dwPermissions & FPDFPERM_MODIFY); 506 (dwPermissions & FPDFPERM_MODIFY);
507 } 507 }
508 508
509 CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, 509 CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot,
510 FX_BOOL bRegister) { 510 FX_BOOL bRegister) {
511 auto it = m_Maps.find(pAnnot); 511 auto it = m_Maps.find(pAnnot);
512 if (it != m_Maps.end()) 512 if (it != m_Maps.end())
513 return it->second; 513 return it->second;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 } 635 }
636 636
637 nRet = bBottom ? 0 : 1; 637 nRet = bBottom ? 0 : 1;
638 fPopupRet = fFactHeight; 638 fPopupRet = fFactHeight;
639 } 639 }
640 640
641 void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, 641 void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget,
642 CPDFSDK_PageView* pPageView, 642 CPDFSDK_PageView* pPageView,
643 FX_BOOL& bRC, 643 FX_BOOL& bRC,
644 FX_BOOL& bExit, 644 FX_BOOL& bExit,
645 FX_DWORD nFlag) { 645 uint32_t nFlag) {
646 if (!m_bNotifying) { 646 if (!m_bNotifying) {
647 if (pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) { 647 if (pWidget->GetAAction(CPDF_AAction::KeyStroke).GetDict()) {
648 m_bNotifying = TRUE; 648 m_bNotifying = TRUE;
649 pWidget->ClearAppModified(); 649 pWidget->ClearAppModified();
650 650
651 ASSERT(pPageView); 651 ASSERT(pPageView);
652 652
653 PDFSDK_FieldAction fa; 653 PDFSDK_FieldAction fa;
654 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); 654 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
655 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); 655 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
(...skipping 11 matching lines...) Expand all
667 bRC = fa.bRC; 667 bRC = fa.bRC;
668 m_bNotifying = FALSE; 668 m_bNotifying = FALSE;
669 } 669 }
670 } 670 }
671 } 671 }
672 672
673 void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, 673 void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget,
674 CPDFSDK_PageView* pPageView, 674 CPDFSDK_PageView* pPageView,
675 FX_BOOL& bRC, 675 FX_BOOL& bRC,
676 FX_BOOL& bExit, 676 FX_BOOL& bExit,
677 FX_DWORD nFlag) { 677 uint32_t nFlag) {
678 if (!m_bNotifying) { 678 if (!m_bNotifying) {
679 if (pWidget->GetAAction(CPDF_AAction::Validate).GetDict()) { 679 if (pWidget->GetAAction(CPDF_AAction::Validate).GetDict()) {
680 m_bNotifying = TRUE; 680 m_bNotifying = TRUE;
681 pWidget->ClearAppModified(); 681 pWidget->ClearAppModified();
682 682
683 ASSERT(pPageView); 683 ASSERT(pPageView);
684 684
685 PDFSDK_FieldAction fa; 685 PDFSDK_FieldAction fa;
686 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); 686 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag);
687 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); 687 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag);
688 fa.bKeyDown = TRUE; 688 fa.bKeyDown = TRUE;
689 fa.bRC = TRUE; 689 fa.bRC = TRUE;
690 690
691 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE); 691 CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE);
692 pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa); 692 pFormFiller->GetActionData(pPageView, CPDF_AAction::Validate, fa);
693 pFormFiller->SaveState(pPageView); 693 pFormFiller->SaveState(pPageView);
694 694
695 PDFSDK_FieldAction faOld = fa; 695 PDFSDK_FieldAction faOld = fa;
696 pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView); 696 pWidget->OnAAction(CPDF_AAction::Validate, fa, pPageView);
697 697
698 bRC = fa.bRC; 698 bRC = fa.bRC;
699 m_bNotifying = FALSE; 699 m_bNotifying = FALSE;
700 } 700 }
701 } 701 }
702 } 702 }
703 703
704 void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget, 704 void CFFL_IFormFiller::OnCalculate(CPDFSDK_Widget* pWidget,
705 CPDFSDK_PageView* pPageView, 705 CPDFSDK_PageView* pPageView,
706 FX_BOOL& bExit, 706 FX_BOOL& bExit,
707 FX_DWORD nFlag) { 707 uint32_t nFlag) {
708 if (!m_bNotifying) { 708 if (!m_bNotifying) {
709 ASSERT(pWidget); 709 ASSERT(pWidget);
710 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); 710 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
711 CPDFSDK_InterForm* pInterForm = 711 CPDFSDK_InterForm* pInterForm =
712 (CPDFSDK_InterForm*)pDocument->GetInterForm(); 712 (CPDFSDK_InterForm*)pDocument->GetInterForm();
713 pInterForm->OnCalculate(pWidget->GetFormField()); 713 pInterForm->OnCalculate(pWidget->GetFormField());
714 714
715 m_bNotifying = FALSE; 715 m_bNotifying = FALSE;
716 } 716 }
717 } 717 }
718 718
719 void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget, 719 void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
720 CPDFSDK_PageView* pPageView, 720 CPDFSDK_PageView* pPageView,
721 FX_BOOL& bExit, 721 FX_BOOL& bExit,
722 FX_DWORD nFlag) { 722 uint32_t nFlag) {
723 if (!m_bNotifying) { 723 if (!m_bNotifying) {
724 ASSERT(pWidget); 724 ASSERT(pWidget);
725 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); 725 CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
726 CPDFSDK_InterForm* pInterForm = 726 CPDFSDK_InterForm* pInterForm =
727 (CPDFSDK_InterForm*)pDocument->GetInterForm(); 727 (CPDFSDK_InterForm*)pDocument->GetInterForm();
728 728
729 FX_BOOL bFormated = FALSE; 729 FX_BOOL bFormated = FALSE;
730 CFX_WideString sValue = 730 CFX_WideString sValue =
731 pInterForm->OnFormat(pWidget->GetFormField(), bFormated); 731 pInterForm->OnFormat(pWidget->GetFormField(), bFormated);
732 732
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 809 }
810 810
811 bReset = TRUE; 811 bReset = TRUE;
812 } 812 }
813 } 813 }
814 } 814 }
815 } 815 }
816 816
817 void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData, 817 void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData,
818 FX_BOOL& bExit, 818 FX_BOOL& bExit,
819 FX_DWORD nFlag) { 819 uint32_t nFlag) {
820 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; 820 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
821 ASSERT(pData); 821 ASSERT(pData);
822 ASSERT(pData->pWidget); 822 ASSERT(pData->pWidget);
823 823
824 FX_BOOL bTempReset = FALSE; 824 FX_BOOL bTempReset = FALSE;
825 FX_BOOL bTempExit = FALSE; 825 FX_BOOL bTempExit = FALSE;
826 OnPreOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, nFlag); 826 OnPreOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, nFlag);
827 827
828 if (bTempReset || bTempExit) { 828 if (bTempReset || bTempExit) {
829 bExit = TRUE; 829 bExit = TRUE;
830 } 830 }
831 } 831 }
832 832
833 void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData, 833 void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData,
834 FX_BOOL& bExit, 834 FX_BOOL& bExit,
835 FX_DWORD nFlag) { 835 uint32_t nFlag) {
836 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; 836 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
837 ASSERT(pData); 837 ASSERT(pData);
838 ASSERT(pData->pWidget); 838 ASSERT(pData->pWidget);
839 839
840 FX_BOOL bTempReset = FALSE; 840 FX_BOOL bTempReset = FALSE;
841 FX_BOOL bTempExit = FALSE; 841 FX_BOOL bTempExit = FALSE;
842 OnPostOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, nFlag); 842 OnPostOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, nFlag);
843 843
844 if (bTempReset || bTempExit) { 844 if (bTempReset || bTempExit) {
845 bExit = TRUE; 845 bExit = TRUE;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 } 926 }
927 927
928 void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData, 928 void CFFL_IFormFiller::OnBeforeKeyStroke(void* pPrivateData,
929 CFX_WideString& strChange, 929 CFX_WideString& strChange,
930 const CFX_WideString& strChangeEx, 930 const CFX_WideString& strChangeEx,
931 int nSelStart, 931 int nSelStart,
932 int nSelEnd, 932 int nSelEnd,
933 FX_BOOL bKeyDown, 933 FX_BOOL bKeyDown,
934 FX_BOOL& bRC, 934 FX_BOOL& bRC,
935 FX_BOOL& bExit, 935 FX_BOOL& bExit,
936 FX_DWORD nFlag) { 936 uint32_t nFlag) {
937 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; 937 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
938 ASSERT(pData->pWidget); 938 ASSERT(pData->pWidget);
939 939
940 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); 940 CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE);
941 941
942 #ifdef PDF_ENABLE_XFA 942 #ifdef PDF_ENABLE_XFA
943 if (pFormFiller->IsFieldFull(pData->pPageView)) { 943 if (pFormFiller->IsFieldFull(pData->pPageView)) {
944 FX_BOOL bFullExit = FALSE; 944 FX_BOOL bFullExit = FALSE;
945 FX_BOOL bFullReset = FALSE; 945 FX_BOOL bFullReset = FALSE;
946 OnFull(pData->pWidget, pData->pPageView, bFullReset, bFullExit, nFlag); 946 OnFull(pData->pWidget, pData->pPageView, bFullReset, bFullExit, nFlag);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 bExit = TRUE; 1007 bExit = TRUE;
1008 m_bNotifying = FALSE; 1008 m_bNotifying = FALSE;
1009 return; 1009 return;
1010 } 1010 }
1011 } 1011 }
1012 1012
1013 m_bNotifying = FALSE; 1013 m_bNotifying = FALSE;
1014 } 1014 }
1015 } 1015 }
1016 } 1016 }
OLDNEW
« no previous file with comments | « fpdfsdk/formfiller/cffl_iformfiller.h ('k') | fpdfsdk/formfiller/cffl_listbox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698