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 "../../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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 } | 1065 } |
1066 else if (vp.IsArrayObject()) | 1066 else if (vp.IsArrayObject()) |
1067 { | 1067 { |
1068 CJS_Array SelArray(m_isolate); | 1068 CJS_Array SelArray(m_isolate); |
1069 CJS_Value SelValue(m_isolate); | 1069 CJS_Value SelValue(m_isolate); |
1070 int iSelecting; | 1070 int iSelecting; |
1071 vp >> SelArray; | 1071 vp >> SelArray; |
1072 for (int i=0,sz=SelArray.GetLength(); i<sz; i++) | 1072 for (int i=0,sz=SelArray.GetLength(); i<sz; i++) |
1073 { | 1073 { |
1074 SelArray.GetElement(i,SelValue); | 1074 SelArray.GetElement(i,SelValue); |
1075 » » » » iSelecting = (FX_INT32)SelValue; | 1075 » » » » iSelecting = SelValue.ToInt(); |
1076 array.Add(iSelecting); | 1076 array.Add(iSelecting); |
1077 } | 1077 } |
1078 } | 1078 } |
1079 | 1079 |
1080 if (m_bDelay) | 1080 if (m_bDelay) |
1081 { | 1081 { |
1082 AddDelay_WordArray(FP_CURRENTVALUEINDICES, array); | 1082 AddDelay_WordArray(FP_CURRENTVALUEINDICES, array); |
1083 } | 1083 } |
1084 else | 1084 else |
1085 { | 1085 { |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2368 | 2368 |
2369 CJS_Array rcArray(m_isolate); | 2369 CJS_Array rcArray(m_isolate); |
2370 vp >> rcArray; | 2370 vp >> rcArray; |
2371 CJS_Value Upper_Leftx(m_isolate), Upper_Lefty(m_isolate), Lower_
Rightx(m_isolate), Lower_Righty(m_isolate); | 2371 CJS_Value Upper_Leftx(m_isolate), Upper_Lefty(m_isolate), Lower_
Rightx(m_isolate), Lower_Righty(m_isolate); |
2372 rcArray.GetElement(0, Upper_Leftx); | 2372 rcArray.GetElement(0, Upper_Leftx); |
2373 rcArray.GetElement(1, Upper_Lefty); | 2373 rcArray.GetElement(1, Upper_Lefty); |
2374 rcArray.GetElement(2, Lower_Rightx); | 2374 rcArray.GetElement(2, Lower_Rightx); |
2375 rcArray.GetElement(3, Lower_Righty); | 2375 rcArray.GetElement(3, Lower_Righty); |
2376 | 2376 |
2377 FX_FLOAT pArray[4] = {0.0f,0.0f,0.0f,0.0f}; | 2377 FX_FLOAT pArray[4] = {0.0f,0.0f,0.0f,0.0f}; |
2378 » » pArray[0] = (FX_FLOAT)(FX_INT32)Upper_Leftx; | 2378 » » pArray[0] = (FX_FLOAT)Upper_Leftx.ToInt(); |
2379 » » pArray[1] = (FX_FLOAT)(FX_INT32)Lower_Righty; | 2379 » » pArray[1] = (FX_FLOAT)Lower_Righty.ToInt(); |
2380 » » pArray[2] = (FX_FLOAT)(FX_INT32)Lower_Rightx; | 2380 » » pArray[2] = (FX_FLOAT)Lower_Rightx.ToInt(); |
2381 » » pArray[3] = (FX_FLOAT)(FX_INT32)Upper_Lefty; | 2381 » » pArray[3] = (FX_FLOAT)Upper_Lefty.ToInt(); |
2382 | 2382 |
2383 CPDF_Rect crRect(pArray); | 2383 CPDF_Rect crRect(pArray); |
2384 | 2384 |
2385 if (m_bDelay) | 2385 if (m_bDelay) |
2386 { | 2386 { |
2387 AddDelay_Rect(FP_RECT, crRect); | 2387 AddDelay_Rect(FP_RECT, crRect); |
2388 } | 2388 } |
2389 else | 2389 else |
2390 { | 2390 { |
2391 Field::SetRect(m_pDocument, m_FieldName, m_nFormControlI
ndex, crRect); | 2391 Field::SetRect(m_pDocument, m_FieldName, m_nFormControlI
ndex, crRect); |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3078 CJS_WideStringArray strArray; | 3078 CJS_WideStringArray strArray; |
3079 | 3079 |
3080 if (vp.IsArrayObject()) | 3080 if (vp.IsArrayObject()) |
3081 { | 3081 { |
3082 CJS_Array ValueArray(m_isolate); | 3082 CJS_Array ValueArray(m_isolate); |
3083 vp.ConvertToArray(ValueArray); | 3083 vp.ConvertToArray(ValueArray); |
3084 for (int i = 0,sz = ValueArray.GetLength(); i < sz; i++) | 3084 for (int i = 0,sz = ValueArray.GetLength(); i < sz; i++) |
3085 { | 3085 { |
3086 CJS_Value ElementValue(m_isolate); | 3086 CJS_Value ElementValue(m_isolate); |
3087 ValueArray.GetElement(i, ElementValue); | 3087 ValueArray.GetElement(i, ElementValue); |
3088 » » » » strArray.Add(ElementValue.operator CFX_WideStrin
g()); | 3088 » » » » strArray.Add(ElementValue.ToCFXWideString()); |
3089 } | 3089 } |
3090 } | 3090 } |
3091 else | 3091 else |
3092 { | 3092 { |
3093 CFX_WideString swValue; | 3093 CFX_WideString swValue; |
3094 vp >> swValue; | 3094 vp >> swValue; |
3095 | 3095 |
3096 strArray.Add(swValue); | 3096 strArray.Add(swValue); |
3097 } | 3097 } |
3098 | 3098 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3142 { | 3142 { |
3143 if (pFormField->CountSelectedItems() > 1) | 3143 if (pFormField->CountSelectedItems() > 1) |
3144 { | 3144 { |
3145 CJS_Array ValueArray(m_isolate); | 3145 CJS_Array ValueArray(m_isolate); |
3146 CJS_Value ElementValue(m_isolate); | 3146 CJS_Value ElementValue(m_isolate); |
3147 int iIndex; | 3147 int iIndex; |
3148 for (int i = 0, sz = pFormField->CountSe
lectedItems(); i < sz; i++) | 3148 for (int i = 0, sz = pFormField->CountSe
lectedItems(); i < sz; i++) |
3149 { | 3149 { |
3150 iIndex = pFormField->GetSelected
Index(i); | 3150 iIndex = pFormField->GetSelected
Index(i); |
3151 ElementValue = pFormField->GetOp
tionValue(iIndex); | 3151 ElementValue = pFormField->GetOp
tionValue(iIndex); |
3152 » » » » » » if (FXSYS_wcslen((FX_LPCWSTR)Ele
mentValue.operator CFX_WideString()) == 0) | 3152 » » » » » » if (FXSYS_wcslen(ElementValue.To
CFXWideString().c_str()) == 0) |
3153 ElementValue = pFormFiel
d->GetOptionLabel(iIndex); | 3153 ElementValue = pFormFiel
d->GetOptionLabel(iIndex); |
3154 ValueArray.SetElement(i, Element
Value); | 3154 ValueArray.SetElement(i, Element
Value); |
3155 } | 3155 } |
3156 vp << ValueArray; | 3156 vp << ValueArray; |
3157 } | 3157 } |
3158 else | 3158 else |
3159 { | 3159 { |
3160 CFX_WideString swValue = pFormField->Get
Value(); | 3160 CFX_WideString swValue = pFormField->Get
Value(); |
3161 | 3161 |
3162 double dRet; | 3162 double dRet; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3367 return TRUE; | 3367 return TRUE; |
3368 } | 3368 } |
3369 | 3369 |
3370 | 3370 |
3371 FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, CFX_WideString& sError) | 3371 FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, CFX_WideString& sError) |
3372 { | 3372 { |
3373 ASSERT(m_pDocument != NULL); | 3373 ASSERT(m_pDocument != NULL); |
3374 | 3374 |
3375 int nface = 0; | 3375 int nface = 0; |
3376 int iSize = params.size(); | 3376 int iSize = params.size(); |
3377 » if ( iSize >= 1) | 3377 » if (iSize >= 1) |
3378 » » nface = (FX_INT32) params[0]; | 3378 » » nface = params[0].ToInt(); |
3379 | 3379 |
3380 CFX_PtrArray FieldArray; | 3380 CFX_PtrArray FieldArray; |
3381 GetFormFields(m_FieldName,FieldArray); | 3381 GetFormFields(m_FieldName,FieldArray); |
3382 if (FieldArray.GetSize() <= 0) return FALSE; | 3382 if (FieldArray.GetSize() <= 0) return FALSE; |
3383 | 3383 |
3384 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); | 3384 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); |
3385 ASSERT(pFormField != NULL); | 3385 ASSERT(pFormField != NULL); |
3386 | 3386 |
3387 if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) | 3387 if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) |
3388 return FALSE; | 3388 return FALSE; |
(...skipping 14 matching lines...) Expand all Loading... |
3403 } | 3403 } |
3404 | 3404 |
3405 //#pragma warning(disable: 4800) | 3405 //#pragma warning(disable: 4800) |
3406 | 3406 |
3407 FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
S_Value& vRet, CFX_WideString& sError) | 3407 FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
S_Value& vRet, CFX_WideString& sError) |
3408 { | 3408 { |
3409 ASSERT(m_pDocument != NULL); | 3409 ASSERT(m_pDocument != NULL); |
3410 | 3410 |
3411 int nface = 0; | 3411 int nface = 0; |
3412 int iSize = params.size(); | 3412 int iSize = params.size(); |
3413 » if ( iSize >= 1) | 3413 » if (iSize >= 1) |
3414 » » nface = (FX_INT32) params[0]; | 3414 » » nface = params[0].ToInt(); |
3415 | 3415 |
3416 CFX_PtrArray FieldArray; | 3416 CFX_PtrArray FieldArray; |
3417 GetFormFields(m_FieldName,FieldArray); | 3417 GetFormFields(m_FieldName,FieldArray); |
3418 if (FieldArray.GetSize() <= 0) return FALSE; | 3418 if (FieldArray.GetSize() <= 0) return FALSE; |
3419 | 3419 |
3420 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); | 3420 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); |
3421 ASSERT(pFormField != NULL); | 3421 ASSERT(pFormField != NULL); |
3422 | 3422 |
3423 if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) | 3423 if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) |
3424 return FALSE; | 3424 return FALSE; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3512 return FALSE; | 3512 return FALSE; |
3513 } | 3513 } |
3514 | 3514 |
3515 FX_BOOL Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, CFX_WideString& sError) | 3515 FX_BOOL Field::checkThisBox(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, CFX_WideString& sError) |
3516 { | 3516 { |
3517 ASSERT(m_pDocument != NULL); | 3517 ASSERT(m_pDocument != NULL); |
3518 | 3518 |
3519 if (!m_bCanSet) return FALSE; | 3519 if (!m_bCanSet) return FALSE; |
3520 | 3520 |
3521 int iSize = params.size(); | 3521 int iSize = params.size(); |
3522 » int nWidget = -1; | 3522 » if (iSize < 1) |
3523 » if ( iSize >= 1) | |
3524 » » nWidget= (FX_INT32) params[0]; | |
3525 » else | |
3526 return FALSE; | 3523 return FALSE; |
| 3524 |
| 3525 int nWidget = params[0].ToInt(); |
| 3526 |
3527 FX_BOOL bCheckit = TRUE; | 3527 FX_BOOL bCheckit = TRUE; |
3528 » if ( iSize >= 2) | 3528 » if (iSize >= 2) |
3529 » » bCheckit = params[1]; | 3529 » » bCheckit = params[1].ToBool(); |
3530 | |
3531 | 3530 |
3532 CFX_PtrArray FieldArray; | 3531 CFX_PtrArray FieldArray; |
3533 GetFormFields(m_FieldName,FieldArray); | 3532 GetFormFields(m_FieldName,FieldArray); |
3534 if (FieldArray.GetSize() <= 0) return FALSE; | 3533 if (FieldArray.GetSize() <= 0) return FALSE; |
3535 | 3534 |
3536 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); | 3535 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); |
3537 ASSERT(pFormField != NULL); | 3536 ASSERT(pFormField != NULL); |
3538 » | 3537 |
3539 if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetF
ieldType() != FIELDTYPE_RADIOBUTTON) | 3538 if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetF
ieldType() != FIELDTYPE_RADIOBUTTON) |
3540 » » return FALSE;» | 3539 » » return FALSE; |
3541 if(nWidget <0 || nWidget >= pFormField->CountControls()) | 3540 if(nWidget <0 || nWidget >= pFormField->CountControls()) |
3542 return FALSE; | 3541 return FALSE; |
3543 if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON) | 3542 if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON) |
3544 pFormField->CheckControl(nWidget, bCheckit, TRUE); | 3543 pFormField->CheckControl(nWidget, bCheckit, TRUE); |
3545 else | 3544 else |
3546 pFormField->CheckControl(nWidget, bCheckit, TRUE); | 3545 pFormField->CheckControl(nWidget, bCheckit, TRUE); |
3547 | 3546 |
3548 UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); | 3547 UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); |
3549 | |
3550 return TRUE; | 3548 return TRUE; |
3551 } | 3549 } |
3552 | 3550 |
3553 FX_BOOL Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, CFX_WideString& sError) | 3551 FX_BOOL Field::clearItems(IFXJS_Context* cc, const CJS_Parameters& params, CJS_V
alue& vRet, CFX_WideString& sError) |
3554 { | 3552 { |
3555 return TRUE; | 3553 return TRUE; |
3556 } | 3554 } |
3557 | 3555 |
3558 FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, CFX_WideString& sError) | 3556 FX_BOOL Field::defaultIsChecked(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, CFX_WideString& sError) |
3559 { | 3557 { |
3560 ASSERT(m_pDocument != NULL); | 3558 ASSERT(m_pDocument != NULL); |
3561 | 3559 |
3562 if (!m_bCanSet) return FALSE; | 3560 if (!m_bCanSet) return FALSE; |
3563 | 3561 |
3564 int iSize = params.size(); | 3562 int iSize = params.size(); |
3565 » int nWidget = -1; | 3563 » if (iSize < 1) |
3566 » if ( iSize >= 1) | |
3567 » » nWidget= (FX_INT32) params[0]; | |
3568 » else | |
3569 return FALSE; | 3564 return FALSE; |
3570 » //FX_BOOL bIsDefaultChecked = TRUE; | 3565 |
3571 » //if ( iSize >= 2) | 3566 » int nWidget = params[0].ToInt(); |
3572 » //» bIsDefaultChecked = params[1]; | |
3573 | 3567 |
3574 CFX_PtrArray FieldArray; | 3568 CFX_PtrArray FieldArray; |
3575 GetFormFields(m_FieldName,FieldArray); | 3569 GetFormFields(m_FieldName,FieldArray); |
3576 if (FieldArray.GetSize() <= 0) return FALSE; | 3570 if (FieldArray.GetSize() <= 0) return FALSE; |
3577 | 3571 |
3578 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); | 3572 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); |
3579 ASSERT(pFormField != NULL); | 3573 ASSERT(pFormField != NULL); |
3580 | 3574 |
3581 if(nWidget <0 || nWidget >= pFormField->CountControls()) | 3575 if(nWidget <0 || nWidget >= pFormField->CountControls()) |
3582 { | 3576 { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3658 } | 3652 } |
3659 | 3653 |
3660 vRet = FormFieldArray; | 3654 vRet = FormFieldArray; |
3661 swSort.RemoveAll(); | 3655 swSort.RemoveAll(); |
3662 return TRUE; | 3656 return TRUE; |
3663 } | 3657 } |
3664 | 3658 |
3665 FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, CFX_WideString& sError) | 3659 FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
lue& vRet, CFX_WideString& sError) |
3666 { | 3660 { |
3667 ASSERT(m_pDocument != NULL); | 3661 ASSERT(m_pDocument != NULL); |
| 3662 int iSize = params.size(); |
3668 | 3663 |
3669 int nIdx = -1; | 3664 int nIdx = -1; |
3670 » if (params.size() >=1) | 3665 » if (iSize >= 1) |
3671 » » nIdx = (FX_INT32) params[0]; | 3666 » » nIdx = params[0].ToInt(); |
| 3667 |
3672 FX_BOOL bExport = TRUE; | 3668 FX_BOOL bExport = TRUE; |
3673 » int iSize = params.size(); | 3669 » if (iSize >= 2) |
3674 » if ( iSize >= 2) | 3670 » » bExport = params[1].ToBool(); |
3675 » { | |
3676 » » bExport =(FX_BOOL) params[1]; | |
3677 » } | |
3678 | 3671 |
3679 CFX_PtrArray FieldArray; | 3672 CFX_PtrArray FieldArray; |
3680 GetFormFields(m_FieldName,FieldArray); | 3673 GetFormFields(m_FieldName,FieldArray); |
3681 if (FieldArray.GetSize() <= 0) return FALSE; | 3674 if (FieldArray.GetSize() <= 0) return FALSE; |
3682 | 3675 |
3683 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); | 3676 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); |
3684 ASSERT(pFormField != NULL); | 3677 ASSERT(pFormField != NULL); |
3685 | 3678 |
3686 if ((pFormField->GetFieldType() == FIELDTYPE_LISTBOX) | 3679 if ((pFormField->GetFieldType() == FIELDTYPE_LISTBOX) |
3687 || (pFormField->GetFieldType() == FIELDTYPE_COMBOBOX)) | 3680 || (pFormField->GetFieldType() == FIELDTYPE_COMBOBOX)) |
(...skipping 25 matching lines...) Expand all Loading... |
3713 FX_BOOL Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, CFX_WideString& sError) | 3706 FX_BOOL Field::insertItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, CFX_WideString& sError) |
3714 { | 3707 { |
3715 return TRUE; | 3708 return TRUE; |
3716 } | 3709 } |
3717 | 3710 |
3718 FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, CFX_WideString& sError) | 3711 FX_BOOL Field::isBoxChecked(IFXJS_Context* cc, const CJS_Parameters& params, CJS
_Value& vRet, CFX_WideString& sError) |
3719 { | 3712 { |
3720 ASSERT(m_pDocument != NULL); | 3713 ASSERT(m_pDocument != NULL); |
3721 | 3714 |
3722 int nIndex = -1; | 3715 int nIndex = -1; |
3723 » if (params.size() >=1) | 3716 » if (params.size() >= 1) |
3724 » » nIndex = (FX_INT32) params[0]; | 3717 » » nIndex = params[0].ToInt(); |
3725 | 3718 |
3726 CFX_PtrArray FieldArray; | 3719 CFX_PtrArray FieldArray; |
3727 GetFormFields(m_FieldName,FieldArray); | 3720 GetFormFields(m_FieldName,FieldArray); |
3728 if (FieldArray.GetSize() <= 0) return FALSE; | 3721 if (FieldArray.GetSize() <= 0) return FALSE; |
3729 | 3722 |
3730 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); | 3723 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); |
3731 ASSERT(pFormField != NULL); | 3724 ASSERT(pFormField != NULL); |
3732 | 3725 |
3733 if(nIndex <0 || nIndex >= pFormField->CountControls()) | 3726 if(nIndex <0 || nIndex >= pFormField->CountControls()) |
3734 { | 3727 { |
(...skipping 13 matching lines...) Expand all Loading... |
3748 vRet = FALSE; | 3741 vRet = FALSE; |
3749 | 3742 |
3750 return TRUE; | 3743 return TRUE; |
3751 } | 3744 } |
3752 | 3745 |
3753 FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, CFX_WideString& sError) | 3746 FX_BOOL Field::isDefaultChecked(IFXJS_Context* cc, const CJS_Parameters& params,
CJS_Value& vRet, CFX_WideString& sError) |
3754 { | 3747 { |
3755 ASSERT(m_pDocument != NULL); | 3748 ASSERT(m_pDocument != NULL); |
3756 | 3749 |
3757 int nIndex = -1; | 3750 int nIndex = -1; |
3758 » if (params.size() >=1) | 3751 » if (params.size() >= 1) |
3759 » » nIndex = (FX_INT32) params[0]; | 3752 » » nIndex = params[0].ToInt(); |
3760 | 3753 |
3761 CFX_PtrArray FieldArray; | 3754 CFX_PtrArray FieldArray; |
3762 GetFormFields(m_FieldName,FieldArray); | 3755 GetFormFields(m_FieldName,FieldArray); |
3763 if (FieldArray.GetSize() <= 0) return FALSE; | 3756 if (FieldArray.GetSize() <= 0) return FALSE; |
3764 | 3757 |
3765 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); | 3758 CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); |
3766 ASSERT(pFormField != NULL); | 3759 ASSERT(pFormField != NULL); |
3767 | 3760 |
3768 if(nIndex <0 || nIndex >= pFormField->CountControls()) | 3761 if(nIndex <0 || nIndex >= pFormField->CountControls()) |
3769 { | 3762 { |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4115 | 4108 |
4116 #define JS_FIELD_MINWIDTH 1 | 4109 #define JS_FIELD_MINWIDTH 1 |
4117 #define JS_FIELD_MINHEIGHT 1 | 4110 #define JS_FIELD_MINHEIGHT 1 |
4118 | 4111 |
4119 void Field::AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType
, | 4112 void Field::AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType
, |
4120 const CFX_WideString& sN
ame, const CPDF_Rect& rcCoords) | 4113 const CFX_WideString& sN
ame, const CPDF_Rect& rcCoords) |
4121 { | 4114 { |
4122 //Not supported. | 4115 //Not supported. |
4123 } | 4116 } |
4124 | 4117 |
OLD | NEW |