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

Side by Side Diff: fpdfsdk/src/javascript/Field.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 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/src/javascript/Document.cpp ('k') | fpdfsdk/src/javascript/JS_GlobalData.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 "../../include/javascript/JavaScript.h" 7 #include "../../include/javascript/JavaScript.h"
8 #include "../../include/javascript/IJavaScript.h" 8 #include "../../include/javascript/IJavaScript.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_Object.h" 10 #include "../../include/javascript/JS_Object.h"
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 return FALSE; 590 return FALSE;
591 591
592 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField ); 592 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField );
593 if (!pFormControl)return FALSE; 593 if (!pFormControl)return FALSE;
594 594
595 CPDF_IconFit IconFit = pFormControl->GetIconFit(); 595 CPDF_IconFit IconFit = pFormControl->GetIconFit();
596 596
597 FX_FLOAT fLeft,fBottom; 597 FX_FLOAT fLeft,fBottom;
598 IconFit.GetIconPosition(fLeft,fBottom); 598 IconFit.GetIconPosition(fLeft,fBottom);
599 599
600 » » vp << (FX_INT32)fLeft; 600 » » vp << (int32_t)fLeft;
601 } 601 }
602 602
603 return TRUE; 603 return TRUE;
604 } 604 }
605 605
606 void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& s wFieldName, int nControlIndex, int number) 606 void Field::SetButtonAlignX(CPDFSDK_Document* pDocument, const CFX_WideString& s wFieldName, int nControlIndex, int number)
607 { 607 {
608 //Not supported. 608 //Not supported.
609 } 609 }
610 610
(...skipping 30 matching lines...) Expand all
641 return FALSE; 641 return FALSE;
642 642
643 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField ); 643 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField );
644 if (!pFormControl)return FALSE; 644 if (!pFormControl)return FALSE;
645 645
646 CPDF_IconFit IconFit = pFormControl->GetIconFit(); 646 CPDF_IconFit IconFit = pFormControl->GetIconFit();
647 647
648 FX_FLOAT fLeft,fBottom; 648 FX_FLOAT fLeft,fBottom;
649 IconFit.GetIconPosition(fLeft,fBottom); 649 IconFit.GetIconPosition(fLeft,fBottom);
650 650
651 » » vp << (FX_INT32)fBottom; 651 » » vp << (int32_t)fBottom;
652 } 652 }
653 653
654 return TRUE; 654 return TRUE;
655 } 655 }
656 656
657 void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& s wFieldName, int nControlIndex, int number) 657 void Field::SetButtonAlignY(CPDFSDK_Document* pDocument, const CFX_WideString& s wFieldName, int nControlIndex, int number)
658 { 658 {
659 //Not supported. 659 //Not supported.
660 } 660 }
661 661
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 ASSERT(pFormField != NULL); 781 ASSERT(pFormField != NULL);
782 782
783 if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) 783 if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
784 return FALSE; 784 return FALSE;
785 785
786 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField ); 786 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField );
787 if (!pFormControl)return FALSE; 787 if (!pFormControl)return FALSE;
788 788
789 CPDF_IconFit IconFit = pFormControl->GetIconFit(); 789 CPDF_IconFit IconFit = pFormControl->GetIconFit();
790 if (IconFit.IsProportionalScale()) 790 if (IconFit.IsProportionalScale())
791 » » » vp << (FX_INT32)0; 791 » » » vp << (int32_t)0;
792 else 792 else
793 » » » vp << (FX_INT32)1; 793 » » » vp << (int32_t)1;
794 } 794 }
795 795
796 return TRUE; 796 return TRUE;
797 } 797 }
798 798
799 void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) 799 void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
800 { 800 {
801 //Not supported. 801 //Not supported.
802 } 802 }
803 803
(...skipping 30 matching lines...) Expand all
834 return FALSE; 834 return FALSE;
835 835
836 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField ); 836 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField );
837 if (!pFormControl) return FALSE; 837 if (!pFormControl) return FALSE;
838 838
839 CPDF_IconFit IconFit = pFormControl->GetIconFit(); 839 CPDF_IconFit IconFit = pFormControl->GetIconFit();
840 int ScaleM = IconFit.GetScaleMethod(); 840 int ScaleM = IconFit.GetScaleMethod();
841 switch (ScaleM) 841 switch (ScaleM)
842 { 842 {
843 case CPDF_IconFit::Always : 843 case CPDF_IconFit::Always :
844 » » » » vp << (FX_INT32) CPDF_IconFit::Always; 844 » » » » vp << (int32_t) CPDF_IconFit::Always;
845 break; 845 break;
846 case CPDF_IconFit::Bigger : 846 case CPDF_IconFit::Bigger :
847 » » » » vp << (FX_INT32) CPDF_IconFit::Bigger; 847 » » » » vp << (int32_t) CPDF_IconFit::Bigger;
848 break; 848 break;
849 case CPDF_IconFit::Never : 849 case CPDF_IconFit::Never :
850 » » » » vp << (FX_INT32) CPDF_IconFit::Never; 850 » » » » vp << (int32_t) CPDF_IconFit::Never;
851 break; 851 break;
852 case CPDF_IconFit::Smaller : 852 case CPDF_IconFit::Smaller :
853 » » » » vp << (FX_INT32) CPDF_IconFit::Smaller; 853 » » » » vp << (int32_t) CPDF_IconFit::Smaller;
854 break; 854 break;
855 } 855 }
856 } 856 }
857 857
858 return TRUE; 858 return TRUE;
859 } 859 }
860 860
861 void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString & swFieldName, int nControlIndex, int number) 861 void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument, const CFX_WideString & swFieldName, int nControlIndex, int number)
862 { 862 {
863 //Not supported. 863 //Not supported.
(...skipping 30 matching lines...) Expand all
894 894
895 if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormFie ld->GetFieldType() != FIELDTYPE_TEXTFIELD) 895 if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && pFormFie ld->GetFieldType() != FIELDTYPE_TEXTFIELD)
896 return FALSE; 896 return FALSE;
897 897
898 CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm(); 898 CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
899 ASSERT(pRDInterForm != NULL); 899 ASSERT(pRDInterForm != NULL);
900 900
901 CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm(); 901 CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
902 ASSERT(pInterForm != NULL); 902 ASSERT(pInterForm != NULL);
903 903
904 » » vp << (FX_INT32)pInterForm->FindFieldInCalculationOrder(pFormFie ld); 904 » » vp << (int32_t)pInterForm->FindFieldInCalculationOrder(pFormFiel d);
905 } 905 }
906 906
907 return TRUE; 907 return TRUE;
908 } 908 }
909 909
910 void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number) 910 void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, int number)
911 { 911 {
912 //Not supported. 912 //Not supported.
913 } 913 }
914 914
(...skipping 22 matching lines...) Expand all
937 CFX_PtrArray FieldArray; 937 CFX_PtrArray FieldArray;
938 GetFormFields(m_FieldName, FieldArray); 938 GetFormFields(m_FieldName, FieldArray);
939 if (FieldArray.GetSize() <= 0) return FALSE; 939 if (FieldArray.GetSize() <= 0) return FALSE;
940 940
941 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.Element At(0); 941 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.Element At(0);
942 ASSERT(pFormField != NULL); 942 ASSERT(pFormField != NULL);
943 943
944 if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD) 944 if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD)
945 return FALSE; 945 return FALSE;
946 946
947 » » vp << (FX_INT32)pFormField->GetMaxLen(); 947 » » vp << (int32_t)pFormField->GetMaxLen();
948 } 948 }
949 return TRUE; 949 return TRUE;
950 } 950 }
951 951
952 void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFi eldName, int nControlIndex, int number) 952 void Field::SetCharLimit(CPDFSDK_Document* pDocument, const CFX_WideString& swFi eldName, int nControlIndex, int number)
953 { 953 {
954 //Not supported. 954 //Not supported.
955 } 955 }
956 956
957 FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError ) 957 FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError )
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 FX_DWORD dwFieldFlags = pFormField->GetFieldFlags(); 1134 FX_DWORD dwFieldFlags = pFormField->GetFieldFlags();
1135 pFormField->ClearSelection(TRUE); 1135 pFormField->ClearSelection(TRUE);
1136 1136
1137 for (int i=0,sz=array.GetSize(); i<sz; i++) 1137 for (int i=0,sz=array.GetSize(); i<sz; i++)
1138 { 1138 {
1139 if (i>0 && !(dwFieldFlags & (1<<21))) 1139 if (i>0 && !(dwFieldFlags & (1<<21)))
1140 { 1140 {
1141 break; 1141 break;
1142 } 1142 }
1143 1143
1144 » » » » int iSelecting = (FX_INT32)array.GetAt(i); 1144 » » » » int iSelecting = (int32_t)array.GetAt(i);
1145 if (iSelecting < pFormField->CountOptions() && ! pFormField->IsItemSelected(iSelecting)) 1145 if (iSelecting < pFormField->CountOptions() && ! pFormField->IsItemSelected(iSelecting))
1146 pFormField->SetItemSelection(iSelecting, TRUE); 1146 pFormField->SetItemSelection(iSelecting, TRUE);
1147 1147
1148 } 1148 }
1149 UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE) ; 1149 UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE) ;
1150 } 1150 }
1151 } 1151 }
1152 } 1152 }
1153 1153
1154 FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString & sError) 1154 FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString & sError)
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument- >GetInterForm(); 1358 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument- >GetInterForm();
1359 ASSERT(pInterForm != NULL); 1359 ASSERT(pInterForm != NULL);
1360 1360
1361 CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldCon trol(pFormField)); 1361 CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldCon trol(pFormField));
1362 if (!pWidget)return FALSE; 1362 if (!pWidget)return FALSE;
1363 1363
1364 FX_DWORD dwFlag = pWidget->GetFlags(); 1364 FX_DWORD dwFlag = pWidget->GetFlags();
1365 1365
1366 if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag) 1366 if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag)
1367 { 1367 {
1368 » » » vp << (FX_INT32)1; 1368 » » » vp << (int32_t)1;
1369 } 1369 }
1370 else 1370 else
1371 { 1371 {
1372 if (ANNOTFLAG_PRINT & dwFlag) 1372 if (ANNOTFLAG_PRINT & dwFlag)
1373 { 1373 {
1374 if (ANNOTFLAG_NOVIEW & dwFlag) 1374 if (ANNOTFLAG_NOVIEW & dwFlag)
1375 { 1375 {
1376 » » » » » vp << (FX_INT32)3; 1376 » » » » » vp << (int32_t)3;
1377 } 1377 }
1378 else 1378 else
1379 { 1379 {
1380 » » » » » vp << (FX_INT32)0; 1380 » » » » » vp << (int32_t)0;
1381 } 1381 }
1382 } 1382 }
1383 else 1383 else
1384 { 1384 {
1385 » » » » vp << (FX_INT32)2; 1385 » » » » vp << (int32_t)2;
1386 } 1386 }
1387 } 1387 }
1388 } 1388 }
1389 1389
1390 return TRUE; 1390 return TRUE;
1391 } 1391 }
1392 1392
1393 void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel dName, int nControlIndex, int number) 1393 void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel dName, int nControlIndex, int number)
1394 { 1394 {
1395 ASSERT(pDocument != NULL); 1395 ASSERT(pDocument != NULL);
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1925 if (!pFormControl) return FALSE; 1925 if (!pFormControl) return FALSE;
1926 1926
1927 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument- >GetInterForm(); 1927 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument- >GetInterForm();
1928 ASSERT(pInterForm != NULL); 1928 ASSERT(pInterForm != NULL);
1929 1929
1930 if(!pFormField->CountControls()) return FALSE; 1930 if(!pFormField->CountControls()) return FALSE;
1931 1931
1932 CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetC ontrol(0)); 1932 CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetC ontrol(0));
1933 if (!pWidget) return FALSE; 1933 if (!pWidget) return FALSE;
1934 1934
1935 » » vp << (FX_INT32)pWidget->GetBorderWidth(); 1935 » » vp << (int32_t)pWidget->GetBorderWidth();
1936 } 1936 }
1937 1937
1938 return TRUE; 1938 return TRUE;
1939 } 1939 }
1940 1940
1941 void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi eldName, int nControlIndex, int number) 1941 void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi eldName, int nControlIndex, int number)
1942 { 1942 {
1943 ASSERT(pDocument != NULL); 1943 ASSERT(pDocument != NULL);
1944 1944
1945 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterF orm(); 1945 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterF orm();
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 2103
2104 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); 2104 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
2105 ASSERT(pFormField != NULL); 2105 ASSERT(pFormField != NULL);
2106 2106
2107 if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX && 2107 if (pFormField->GetFieldType() != FIELDTYPE_COMBOBOX &&
2108 pFormField->GetFieldType() != FIELDTYPE_LISTBOX) 2108 pFormField->GetFieldType() != FIELDTYPE_LISTBOX)
2109 return FALSE; 2109 return FALSE;
2110 2110
2111 if (!vp.IsGetting()) return FALSE; 2111 if (!vp.IsGetting()) return FALSE;
2112 2112
2113 » vp << (FX_INT32)pFormField->CountOptions(); 2113 » vp << (int32_t)pFormField->CountOptions();
2114 2114
2115 return TRUE; 2115 return TRUE;
2116 } 2116 }
2117 2117
2118 FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError ) 2118 FX_BOOL Field::page(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError )
2119 { 2119 {
2120 if (!vp.IsGetting()) return FALSE; 2120 if (!vp.IsGetting()) return FALSE;
2121 2121
2122 CFX_PtrArray FieldArray; 2122 CFX_PtrArray FieldArray;
2123 GetFormFields(m_FieldName, FieldArray); 2123 GetFormFields(m_FieldName, FieldArray);
(...skipping 16 matching lines...) Expand all
2140 2140
2141 for (int i=0,sz=widgetArray.GetSize(); i<sz; i++) 2141 for (int i=0,sz=widgetArray.GetSize(); i<sz; i++)
2142 { 2142 {
2143 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgetArray.G etAt(i); 2143 CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgetArray.G etAt(i);
2144 ASSERT(pWidget != NULL); 2144 ASSERT(pWidget != NULL);
2145 2145
2146 CPDFSDK_PageView* pPageView = pWidget->GetPageView(); 2146 CPDFSDK_PageView* pPageView = pWidget->GetPageView();
2147 if(!pPageView) 2147 if(!pPageView)
2148 return FALSE; 2148 return FALSE;
2149 2149
2150 » » » PageArray.SetElement(i, CJS_Value(m_isolate,(FX_INT32)pP ageView->GetPageIndex())); 2150 » » » PageArray.SetElement(i, CJS_Value(m_isolate,(int32_t)pPa geView->GetPageIndex()));
2151 } 2151 }
2152 2152
2153 vp << PageArray; 2153 vp << PageArray;
2154 } 2154 }
2155 else 2155 else
2156 { 2156 {
2157 » » vp << (FX_INT32) -1; 2157 » » vp << (int32_t) -1;
2158 } 2158 }
2159 2159
2160 return TRUE; 2160 return TRUE;
2161 } 2161 }
2162 2162
2163 FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE rror) 2163 FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE rror)
2164 { 2164 {
2165 ASSERT(m_pDocument != NULL); 2165 ASSERT(m_pDocument != NULL);
2166 2166
2167 if (vp.IsSetting()) 2167 if (vp.IsSetting())
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
2400 ASSERT(pFormField != NULL); 2400 ASSERT(pFormField != NULL);
2401 2401
2402 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument- >GetInterForm(); 2402 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument- >GetInterForm();
2403 ASSERT(pInterForm != NULL); 2403 ASSERT(pInterForm != NULL);
2404 2404
2405 CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldCon trol(pFormField)); 2405 CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldCon trol(pFormField));
2406 if (!pWidget) return FALSE; 2406 if (!pWidget) return FALSE;
2407 2407
2408 CFX_FloatRect crRect = pWidget->GetRect(); 2408 CFX_FloatRect crRect = pWidget->GetRect();
2409 CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Ri ghtx(m_isolate),Lower_Righty(m_isolate); 2409 CJS_Value Upper_Leftx(m_isolate),Upper_Lefty(m_isolate),Lower_Ri ghtx(m_isolate),Lower_Righty(m_isolate);
2410 » » Upper_Leftx = (FX_INT32)crRect.left; 2410 » » Upper_Leftx = (int32_t)crRect.left;
2411 » » Upper_Lefty = (FX_INT32)crRect.top; 2411 » » Upper_Lefty = (int32_t)crRect.top;
2412 » » Lower_Rightx = (FX_INT32)crRect.right; 2412 » » Lower_Rightx = (int32_t)crRect.right;
2413 » » Lower_Righty = (FX_INT32)crRect.bottom; 2413 » » Lower_Righty = (int32_t)crRect.bottom;
2414 2414
2415 CJS_Array rcArray(m_isolate); 2415 CJS_Array rcArray(m_isolate);
2416 rcArray.SetElement(0,Upper_Leftx); 2416 rcArray.SetElement(0,Upper_Leftx);
2417 rcArray.SetElement(1,Upper_Lefty); 2417 rcArray.SetElement(1,Upper_Lefty);
2418 rcArray.SetElement(2,Lower_Rightx); 2418 rcArray.SetElement(2,Lower_Rightx);
2419 rcArray.SetElement(3,Lower_Righty); 2419 rcArray.SetElement(3,Lower_Righty);
2420 2420
2421 vp << rcArray; 2421 vp << rcArray;
2422 } 2422 }
2423 2423
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 CFX_PtrArray FieldArray; 2636 CFX_PtrArray FieldArray;
2637 GetFormFields(m_FieldName,FieldArray); 2637 GetFormFields(m_FieldName,FieldArray);
2638 if (FieldArray.GetSize() <= 0) return FALSE; 2638 if (FieldArray.GetSize() <= 0) return FALSE;
2639 2639
2640 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.Element At(0); 2640 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.Element At(0);
2641 ASSERT(pFormField != NULL); 2641 ASSERT(pFormField != NULL);
2642 2642
2643 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField ); 2643 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField );
2644 if (!pFormControl)return FALSE; 2644 if (!pFormControl)return FALSE;
2645 2645
2646 » » vp << (FX_INT32)pFormControl->GetRotation(); 2646 » » vp << (int32_t)pFormControl->GetRotation();
2647 } 2647 }
2648 2648
2649 return TRUE; 2649 return TRUE;
2650 } 2650 }
2651 2651
2652 void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFie ldName, int nControlIndex, int number) 2652 void Field::SetRotation(CPDFSDK_Document* pDocument, const CFX_WideString& swFie ldName, int nControlIndex, int number)
2653 { 2653 {
2654 //Not supported. 2654 //Not supported.
2655 } 2655 }
2656 2656
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2843 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.Element At(0); 2843 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.Element At(0);
2844 ASSERT(pFormField != NULL); 2844 ASSERT(pFormField != NULL);
2845 2845
2846 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField ); 2846 CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField );
2847 if (!pFormControl)return FALSE; 2847 if (!pFormControl)return FALSE;
2848 2848
2849 int iColorType; 2849 int iColorType;
2850 FX_ARGB color; 2850 FX_ARGB color;
2851 CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaul tAppearance(); 2851 CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaul tAppearance();
2852 FieldAppearance.GetColor(color, iColorType); 2852 FieldAppearance.GetColor(color, iColorType);
2853 » » FX_INT32 a,r,g,b; 2853 » » int32_t a,r,g,b;
2854 ArgbDecode(color, a, r, g, b); 2854 ArgbDecode(color, a, r, g, b);
2855 2855
2856 CPWL_Color crRet = CPWL_Color(COLORTYPE_RGB, r / 255.0f, 2856 CPWL_Color crRet = CPWL_Color(COLORTYPE_RGB, r / 255.0f,
2857 g / 255.0f, 2857 g / 255.0f,
2858 b / 255.0f); 2858 b / 255.0f);
2859 2859
2860 if (iColorType == COLORTYPE_TRANSPARENT) 2860 if (iColorType == COLORTYPE_TRANSPARENT)
2861 crRet = CPWL_Color(COLORTYPE_TRANSPARENT); 2861 crRet = CPWL_Color(COLORTYPE_TRANSPARENT);
2862 2862
2863 CJS_Array crArray(m_isolate); 2863 CJS_Array crArray(m_isolate);
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
3784 { 3784 {
3785 ASSERT(m_pDocument != NULL); 3785 ASSERT(m_pDocument != NULL);
3786 3786
3787 CFX_PtrArray FieldArray; 3787 CFX_PtrArray FieldArray;
3788 GetFormFields(m_FieldName,FieldArray); 3788 GetFormFields(m_FieldName,FieldArray);
3789 if (FieldArray.GetSize() <= 0) return FALSE; 3789 if (FieldArray.GetSize() <= 0) return FALSE;
3790 3790
3791 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); 3791 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
3792 ASSERT(pFormField != NULL); 3792 ASSERT(pFormField != NULL);
3793 3793
3794 » FX_INT32 nCount = pFormField->CountControls(); 3794 » int32_t nCount = pFormField->CountControls();
3795 3795
3796 if (nCount < 1) return FALSE; 3796 if (nCount < 1) return FALSE;
3797 3797
3798 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte rForm(); 3798 CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInte rForm();
3799 ASSERT(pInterForm != NULL); 3799 ASSERT(pInterForm != NULL);
3800 3800
3801 CPDFSDK_Widget* pWidget = NULL; 3801 CPDFSDK_Widget* pWidget = NULL;
3802 if (nCount == 1) 3802 if (nCount == 1)
3803 { 3803 {
3804 pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); 3804 pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
3805 } 3805 }
3806 else 3806 else
3807 { 3807 {
3808 CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); 3808 CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
3809 ASSERT(pEnv); 3809 ASSERT(pEnv);
3810 CPDFXFA_Page* pPage = (CPDFXFA_Page*)pEnv->FFI_GetCurrentPage(m_ pDocument->GetDocument()); 3810 CPDFXFA_Page* pPage = (CPDFXFA_Page*)pEnv->FFI_GetCurrentPage(m_ pDocument->GetDocument());
3811 if(!pPage) 3811 if(!pPage)
3812 return FALSE; 3812 return FALSE;
3813 if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pP age)) 3813 if (CPDFSDK_PageView* pCurPageView = m_pDocument->GetPageView(pP age))
3814 { 3814 {
3815 » » » for (FX_INT32 i=0; i<nCount; i++) 3815 » » » for (int32_t i=0; i<nCount; i++)
3816 { 3816 {
3817 if (CPDFSDK_Widget* pTempWidget = pInterForm->G etWidget(pFormField->GetControl(i))) 3817 if (CPDFSDK_Widget* pTempWidget = pInterForm->G etWidget(pFormField->GetControl(i)))
3818 { 3818 {
3819 if (pTempWidget->GetPDFPage() == pCurPag eView->GetPDFPage()) 3819 if (pTempWidget->GetPDFPage() == pCurPag eView->GetPDFPage())
3820 { 3820 {
3821 pWidget = pTempWidget; 3821 pWidget = pTempWidget;
3822 break; 3822 break;
3823 } 3823 }
3824 } 3824 }
3825 } 3825 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
3879 if (vp.IsGetting()) 3879 if (vp.IsGetting())
3880 { 3880 {
3881 vp << (CJS_Object*)NULL; 3881 vp << (CJS_Object*)NULL;
3882 } 3882 }
3883 3883
3884 return TRUE; 3884 return TRUE;
3885 } 3885 }
3886 3886
3887 /////////////////////////////////////////// delay ////////////////////////////// /////////////// 3887 /////////////////////////////////////////// delay ////////////////////////////// ///////////////
3888 3888
3889 void Field::AddDelay_Int(enum FIELD_PROP prop, FX_INT32 n) 3889 void Field::AddDelay_Int(enum FIELD_PROP prop, int32_t n)
3890 { 3890 {
3891 ASSERT(m_pJSDoc != NULL); 3891 ASSERT(m_pJSDoc != NULL);
3892 3892
3893 CJS_DelayData* pNewData = new CJS_DelayData; 3893 CJS_DelayData* pNewData = new CJS_DelayData;
3894 pNewData->sFieldName = m_FieldName; 3894 pNewData->sFieldName = m_FieldName;
3895 pNewData->nControlIndex = m_nFormControlIndex; 3895 pNewData->nControlIndex = m_nFormControlIndex;
3896 pNewData->eProp = prop; 3896 pNewData->eProp = prop;
3897 pNewData->num = n; 3897 pNewData->num = n;
3898 3898
3899 m_pJSDoc->AddDelayData(pNewData); 3899 m_pJSDoc->AddDelayData(pNewData);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
4106 4106
4107 #define JS_FIELD_MINWIDTH 1 4107 #define JS_FIELD_MINWIDTH 1
4108 #define JS_FIELD_MINHEIGHT 1 4108 #define JS_FIELD_MINHEIGHT 1
4109 4109
4110 void Field::AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType , 4110 void Field::AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType ,
4111 const CFX_WideString& sN ame, const CPDF_Rect& rcCoords) 4111 const CFX_WideString& sN ame, const CPDF_Rect& rcCoords)
4112 { 4112 {
4113 //Not supported. 4113 //Not supported.
4114 } 4114 }
4115 4115
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Document.cpp ('k') | fpdfsdk/src/javascript/JS_GlobalData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698