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 "fpdfsdk/include/formfiller/FFL_IFormFiller.h" | 7 #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" |
8 | 8 |
9 #include "fpdfsdk/include/formfiller/FFL_CheckBox.h" | 9 #include "fpdfsdk/include/formfiller/FFL_CheckBox.h" |
10 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" | 10 #include "fpdfsdk/include/formfiller/FFL_ComboBox.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 m_bNotifying = FALSE; | 740 m_bNotifying = FALSE; |
741 } | 741 } |
742 } | 742 } |
743 | 743 |
744 #ifdef PDF_ENABLE_XFA | 744 #ifdef PDF_ENABLE_XFA |
745 void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget, | 745 void CFFL_IFormFiller::OnClick(CPDFSDK_Widget* pWidget, |
746 CPDFSDK_PageView* pPageView, | 746 CPDFSDK_PageView* pPageView, |
747 FX_BOOL& bReset, | 747 FX_BOOL& bReset, |
748 FX_BOOL& bExit, | 748 FX_BOOL& bExit, |
749 FX_UINT nFlag) { | 749 FX_UINT nFlag) { |
750 ASSERT(pWidget != NULL); | |
751 | |
752 if (!m_bNotifying) { | 750 if (!m_bNotifying) { |
753 if (pWidget->HasXFAAAction(PDFSDK_XFA_Click)) { | 751 if (pWidget->HasXFAAAction(PDFSDK_XFA_Click)) { |
754 m_bNotifying = TRUE; | 752 m_bNotifying = TRUE; |
755 int nAge = pWidget->GetAppearanceAge(); | 753 int nAge = pWidget->GetAppearanceAge(); |
756 int nValueAge = pWidget->GetValueAge(); | 754 int nValueAge = pWidget->GetValueAge(); |
757 | 755 |
758 PDFSDK_FieldAction fa; | 756 PDFSDK_FieldAction fa; |
759 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 757 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
760 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 758 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
761 | 759 |
(...skipping 15 matching lines...) Expand all Loading... |
777 } | 775 } |
778 } | 776 } |
779 } | 777 } |
780 } | 778 } |
781 | 779 |
782 void CFFL_IFormFiller::OnFull(CPDFSDK_Widget* pWidget, | 780 void CFFL_IFormFiller::OnFull(CPDFSDK_Widget* pWidget, |
783 CPDFSDK_PageView* pPageView, | 781 CPDFSDK_PageView* pPageView, |
784 FX_BOOL& bReset, | 782 FX_BOOL& bReset, |
785 FX_BOOL& bExit, | 783 FX_BOOL& bExit, |
786 FX_UINT nFlag) { | 784 FX_UINT nFlag) { |
787 ASSERT(pWidget != NULL); | |
788 | |
789 if (!m_bNotifying) { | 785 if (!m_bNotifying) { |
790 if (pWidget->HasXFAAAction(PDFSDK_XFA_Full)) { | 786 if (pWidget->HasXFAAAction(PDFSDK_XFA_Full)) { |
791 m_bNotifying = TRUE; | 787 m_bNotifying = TRUE; |
792 int nAge = pWidget->GetAppearanceAge(); | 788 int nAge = pWidget->GetAppearanceAge(); |
793 int nValueAge = pWidget->GetValueAge(); | 789 int nValueAge = pWidget->GetValueAge(); |
794 | 790 |
795 PDFSDK_FieldAction fa; | 791 PDFSDK_FieldAction fa; |
796 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 792 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
797 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 793 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
798 | 794 |
(...skipping 13 matching lines...) Expand all Loading... |
812 | 808 |
813 bReset = TRUE; | 809 bReset = TRUE; |
814 } | 810 } |
815 } | 811 } |
816 } | 812 } |
817 } | 813 } |
818 | 814 |
819 void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData, | 815 void CFFL_IFormFiller::OnPopupPreOpen(void* pPrivateData, |
820 FX_BOOL& bExit, | 816 FX_BOOL& bExit, |
821 FX_DWORD nFlag) { | 817 FX_DWORD nFlag) { |
822 ASSERT(pPrivateData != NULL); | |
823 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; | 818 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; |
824 ASSERT(pData->pWidget != NULL); | 819 ASSERT(pData); |
| 820 ASSERT(pData->pWidget); |
825 | 821 |
826 FX_BOOL bTempReset = FALSE; | 822 FX_BOOL bTempReset = FALSE; |
827 FX_BOOL bTempExit = FALSE; | 823 FX_BOOL bTempExit = FALSE; |
828 this->OnPreOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, | 824 this->OnPreOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, |
829 nFlag); | 825 nFlag); |
830 | 826 |
831 if (bTempReset || bTempExit) { | 827 if (bTempReset || bTempExit) { |
832 bExit = TRUE; | 828 bExit = TRUE; |
833 } | 829 } |
834 } | 830 } |
835 | 831 |
836 void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData, | 832 void CFFL_IFormFiller::OnPopupPostOpen(void* pPrivateData, |
837 FX_BOOL& bExit, | 833 FX_BOOL& bExit, |
838 FX_DWORD nFlag) { | 834 FX_DWORD nFlag) { |
839 ASSERT(pPrivateData != NULL); | |
840 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; | 835 CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; |
841 ASSERT(pData->pWidget != NULL); | 836 ASSERT(pData); |
| 837 ASSERT(pData->pWidget); |
842 | 838 |
843 FX_BOOL bTempReset = FALSE; | 839 FX_BOOL bTempReset = FALSE; |
844 FX_BOOL bTempExit = FALSE; | 840 FX_BOOL bTempExit = FALSE; |
845 this->OnPostOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, | 841 this->OnPostOpen(pData->pWidget, pData->pPageView, bTempReset, bTempExit, |
846 nFlag); | 842 nFlag); |
847 | 843 |
848 if (bTempReset || bTempExit) { | 844 if (bTempReset || bTempExit) { |
849 bExit = TRUE; | 845 bExit = TRUE; |
850 } | 846 } |
851 } | 847 } |
852 | 848 |
853 void CFFL_IFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget, | 849 void CFFL_IFormFiller::OnPreOpen(CPDFSDK_Widget* pWidget, |
854 CPDFSDK_PageView* pPageView, | 850 CPDFSDK_PageView* pPageView, |
855 FX_BOOL& bReset, | 851 FX_BOOL& bReset, |
856 FX_BOOL& bExit, | 852 FX_BOOL& bExit, |
857 FX_UINT nFlag) { | 853 FX_UINT nFlag) { |
858 ASSERT(pWidget != NULL); | |
859 | |
860 if (!m_bNotifying) { | 854 if (!m_bNotifying) { |
861 if (pWidget->HasXFAAAction(PDFSDK_XFA_PreOpen)) { | 855 if (pWidget->HasXFAAAction(PDFSDK_XFA_PreOpen)) { |
862 m_bNotifying = TRUE; | 856 m_bNotifying = TRUE; |
863 int nAge = pWidget->GetAppearanceAge(); | 857 int nAge = pWidget->GetAppearanceAge(); |
864 int nValueAge = pWidget->GetValueAge(); | 858 int nValueAge = pWidget->GetValueAge(); |
865 | 859 |
866 PDFSDK_FieldAction fa; | 860 PDFSDK_FieldAction fa; |
867 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 861 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
868 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 862 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
869 | 863 |
(...skipping 15 matching lines...) Expand all Loading... |
885 } | 879 } |
886 } | 880 } |
887 } | 881 } |
888 } | 882 } |
889 | 883 |
890 void CFFL_IFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget, | 884 void CFFL_IFormFiller::OnPostOpen(CPDFSDK_Widget* pWidget, |
891 CPDFSDK_PageView* pPageView, | 885 CPDFSDK_PageView* pPageView, |
892 FX_BOOL& bReset, | 886 FX_BOOL& bReset, |
893 FX_BOOL& bExit, | 887 FX_BOOL& bExit, |
894 FX_UINT nFlag) { | 888 FX_UINT nFlag) { |
895 ASSERT(pWidget != NULL); | |
896 | |
897 if (!m_bNotifying) { | 889 if (!m_bNotifying) { |
898 if (pWidget->HasXFAAAction(PDFSDK_XFA_PostOpen)) { | 890 if (pWidget->HasXFAAAction(PDFSDK_XFA_PostOpen)) { |
899 m_bNotifying = TRUE; | 891 m_bNotifying = TRUE; |
900 int nAge = pWidget->GetAppearanceAge(); | 892 int nAge = pWidget->GetAppearanceAge(); |
901 int nValueAge = pWidget->GetValueAge(); | 893 int nValueAge = pWidget->GetValueAge(); |
902 | 894 |
903 PDFSDK_FieldAction fa; | 895 PDFSDK_FieldAction fa; |
904 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); | 896 fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); |
905 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); | 897 fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); |
906 | 898 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 bExit = TRUE; | 1007 bExit = TRUE; |
1016 m_bNotifying = FALSE; | 1008 m_bNotifying = FALSE; |
1017 return; | 1009 return; |
1018 } | 1010 } |
1019 } | 1011 } |
1020 | 1012 |
1021 m_bNotifying = FALSE; | 1013 m_bNotifying = FALSE; |
1022 } | 1014 } |
1023 } | 1015 } |
1024 } | 1016 } |
OLD | NEW |