| Index: fpdfsdk/javascript/Field.cpp
|
| diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
|
| index 6d11560a17b1b21779dbd662dd0d23178657d5e0..6fe27ec0f6ad70d3dd99a324e6b1b970f8335fcd 100644
|
| --- a/fpdfsdk/javascript/Field.cpp
|
| +++ b/fpdfsdk/javascript/Field.cpp
|
| @@ -175,7 +175,7 @@ void CJS_Field::InitInstance(IJS_Runtime* pIRuntime) {
|
| Field::Field(CJS_Object* pJSObject)
|
| : CJS_EmbedObj(pJSObject),
|
| m_pJSDoc(nullptr),
|
| - m_pDocument(nullptr),
|
| + m_pFormFillEnv(nullptr),
|
| m_nFormControlIndex(-1),
|
| m_bCanSet(FALSE),
|
| m_bDelay(FALSE) {}
|
| @@ -212,12 +212,14 @@ void Field::ParseFieldName(const std::wstring& strFieldNameParsed,
|
| FX_BOOL Field::AttachField(Document* pDocument,
|
| const CFX_WideString& csFieldName) {
|
| m_pJSDoc = pDocument;
|
| - m_pDocument.Reset(pDocument->GetReaderDoc());
|
| - m_bCanSet = m_pDocument->GetPermissions(FPDFPERM_FILL_FORM) ||
|
| - m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
|
| - m_pDocument->GetPermissions(FPDFPERM_MODIFY);
|
| -
|
| - CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
|
| + m_pFormFillEnv.Reset(pDocument->GetReaderDoc()->GetEnv());
|
| + m_bCanSet =
|
| + m_pFormFillEnv->GetSDKDocument()->GetPermissions(FPDFPERM_FILL_FORM) ||
|
| + m_pFormFillEnv->GetSDKDocument()->GetPermissions(FPDFPERM_ANNOT_FORM) ||
|
| + m_pFormFillEnv->GetSDKDocument()->GetPermissions(FPDFPERM_MODIFY);
|
| +
|
| + CPDFSDK_InterForm* pRDInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
|
| CFX_WideString swFieldNameTemp = csFieldName;
|
| swFieldNameTemp.Replace(L"..", L".");
|
| @@ -241,10 +243,11 @@ FX_BOOL Field::AttachField(Document* pDocument,
|
| }
|
|
|
| std::vector<CPDF_FormField*> Field::GetFormFields(
|
| - CPDFSDK_Document* pDocument,
|
| + CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& csFieldName) {
|
| std::vector<CPDF_FormField*> fields;
|
| - CPDFSDK_InterForm* pReaderInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pReaderInterForm =
|
| + pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDF_InterForm* pInterForm = pReaderInterForm->GetInterForm();
|
| for (int i = 0, sz = pInterForm->CountFields(csFieldName); i < sz; ++i) {
|
| if (CPDF_FormField* pFormField = pInterForm->GetField(i, csFieldName))
|
| @@ -255,15 +258,16 @@ std::vector<CPDF_FormField*> Field::GetFormFields(
|
|
|
| std::vector<CPDF_FormField*> Field::GetFormFields(
|
| const CFX_WideString& csFieldName) const {
|
| - return Field::GetFormFields(m_pDocument.Get(), csFieldName);
|
| + return Field::GetFormFields(m_pFormFillEnv.Get(), csFieldName);
|
| }
|
|
|
| -void Field::UpdateFormField(CPDFSDK_Document* pDocument,
|
| +void Field::UpdateFormField(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| CPDF_FormField* pFormField,
|
| FX_BOOL bChangeMark,
|
| FX_BOOL bResetAP,
|
| FX_BOOL bRefresh) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + pFormFillEnv->GetSDKDocument()->GetInterForm();
|
|
|
| if (bResetAP) {
|
| std::vector<CPDFSDK_Widget*> widgets;
|
| @@ -304,17 +308,17 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument,
|
| }
|
|
|
| if (bChangeMark)
|
| - pDocument->SetChangeMark();
|
| + pFormFillEnv->GetSDKDocument()->SetChangeMark();
|
| }
|
|
|
| -void Field::UpdateFormControl(CPDFSDK_Document* pDocument,
|
| +void Field::UpdateFormControl(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| CPDF_FormControl* pFormControl,
|
| FX_BOOL bChangeMark,
|
| FX_BOOL bResetAP,
|
| FX_BOOL bRefresh) {
|
| ASSERT(pFormControl);
|
|
|
| - CPDFSDK_InterForm* pForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pForm = pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl, false);
|
|
|
| if (pWidget) {
|
| @@ -338,14 +342,14 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument,
|
| }
|
|
|
| if (bChangeMark)
|
| - pDocument->SetChangeMark();
|
| + pFormFillEnv->GetSDKDocument()->SetChangeMark();
|
| }
|
|
|
| -CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument,
|
| +CPDFSDK_Widget* Field::GetWidget(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| CPDF_FormControl* pFormControl,
|
| bool createIfNeeded) {
|
| - CPDFSDK_InterForm* pInterForm =
|
| - static_cast<CPDFSDK_InterForm*>(pDocument->GetInterForm());
|
| + CPDFSDK_InterForm* pInterForm = static_cast<CPDFSDK_InterForm*>(
|
| + pFormFillEnv->GetSDKDocument()->GetInterForm());
|
| return pInterForm ? pInterForm->GetWidget(pFormControl, createIfNeeded)
|
| : nullptr;
|
| }
|
| @@ -374,7 +378,7 @@ CPDF_FormControl* Field::GetSmartFieldControl(CPDF_FormField* pFormField) {
|
| FX_BOOL Field::alignment(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -386,8 +390,8 @@ FX_BOOL Field::alignment(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_String(FP_ALIGNMENT, alignStr);
|
| } else {
|
| - Field::SetAlignment(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - alignStr);
|
| + Field::SetAlignment(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, alignStr);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -420,7 +424,7 @@ FX_BOOL Field::alignment(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetAlignment(CPDFSDK_Document* pDocument,
|
| +void Field::SetAlignment(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_ByteString& string) {
|
| @@ -430,7 +434,7 @@ void Field::SetAlignment(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::borderStyle(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -442,8 +446,8 @@ FX_BOOL Field::borderStyle(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_String(FP_BORDERSTYLE, strType);
|
| } else {
|
| - Field::SetBorderStyle(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - strType);
|
| + Field::SetBorderStyle(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, strType);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -454,8 +458,8 @@ FX_BOOL Field::borderStyle(IJS_Context* cc,
|
| if (!pFormField)
|
| return FALSE;
|
|
|
| - CPDFSDK_Widget* pWidget =
|
| - GetWidget(m_pDocument.Get(), GetSmartFieldControl(pFormField), false);
|
| + CPDFSDK_Widget* pWidget = GetWidget(
|
| + m_pFormFillEnv.Get(), GetSmartFieldControl(pFormField), false);
|
| if (!pWidget)
|
| return FALSE;
|
|
|
| @@ -484,11 +488,11 @@ FX_BOOL Field::borderStyle(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetBorderStyle(CPDFSDK_Document* pDocument,
|
| +void Field::SetBorderStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_ByteString& string) {
|
| - ASSERT(pDocument);
|
| + ASSERT(pFormFillEnv);
|
|
|
| BorderStyle nBorderStyle = BorderStyle::SOLID;
|
| if (string == "solid")
|
| @@ -505,13 +509,13 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument,
|
| return;
|
|
|
| std::vector<CPDF_FormField*> FieldArray =
|
| - GetFormFields(pDocument, swFieldName);
|
| + GetFormFields(pFormFillEnv, swFieldName);
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| if (nControlIndex < 0) {
|
| FX_BOOL bSet = FALSE;
|
| for (int i = 0, sz = pFormField->CountControls(); i < sz; ++i) {
|
| if (CPDFSDK_Widget* pWidget =
|
| - GetWidget(pDocument, pFormField->GetControl(i), false)) {
|
| + GetWidget(pFormFillEnv, pFormField->GetControl(i), false)) {
|
| if (pWidget->GetBorderStyle() != nBorderStyle) {
|
| pWidget->SetBorderStyle(nBorderStyle);
|
| bSet = TRUE;
|
| @@ -519,17 +523,17 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument,
|
| }
|
| }
|
| if (bSet)
|
| - UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, TRUE, TRUE);
|
| } else {
|
| if (nControlIndex >= pFormField->CountControls())
|
| return;
|
| if (CPDF_FormControl* pFormControl =
|
| pFormField->GetControl(nControlIndex)) {
|
| if (CPDFSDK_Widget* pWidget =
|
| - GetWidget(pDocument, pFormControl, false)) {
|
| + GetWidget(pFormFillEnv, pFormControl, false)) {
|
| if (pWidget->GetBorderStyle() != nBorderStyle) {
|
| pWidget->SetBorderStyle(nBorderStyle);
|
| - UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
|
| + UpdateFormControl(pFormFillEnv, pFormControl, TRUE, TRUE, TRUE);
|
| }
|
| }
|
| }
|
| @@ -540,7 +544,7 @@ void Field::SetBorderStyle(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::buttonAlignX(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -552,7 +556,7 @@ FX_BOOL Field::buttonAlignX(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_BUTTONALIGNX, nVP);
|
| } else {
|
| - Field::SetButtonAlignX(m_pDocument.Get(), m_FieldName,
|
| + Field::SetButtonAlignX(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, nVP);
|
| }
|
| } else {
|
| @@ -579,7 +583,7 @@ FX_BOOL Field::buttonAlignX(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetButtonAlignX(CPDFSDK_Document* pDocument,
|
| +void Field::SetButtonAlignX(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -589,7 +593,7 @@ void Field::SetButtonAlignX(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::buttonAlignY(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -601,7 +605,7 @@ FX_BOOL Field::buttonAlignY(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_BUTTONALIGNY, nVP);
|
| } else {
|
| - Field::SetButtonAlignY(m_pDocument.Get(), m_FieldName,
|
| + Field::SetButtonAlignY(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, nVP);
|
| }
|
| } else {
|
| @@ -628,7 +632,7 @@ FX_BOOL Field::buttonAlignY(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetButtonAlignY(CPDFSDK_Document* pDocument,
|
| +void Field::SetButtonAlignY(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -638,7 +642,7 @@ void Field::SetButtonAlignY(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::buttonFitBounds(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -650,7 +654,7 @@ FX_BOOL Field::buttonFitBounds(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_BUTTONFITBOUNDS, bVP);
|
| } else {
|
| - Field::SetButtonFitBounds(m_pDocument.Get(), m_FieldName,
|
| + Field::SetButtonFitBounds(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, bVP);
|
| }
|
| } else {
|
| @@ -672,7 +676,7 @@ FX_BOOL Field::buttonFitBounds(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument,
|
| +void Field::SetButtonFitBounds(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| @@ -682,7 +686,7 @@ void Field::SetButtonFitBounds(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::buttonPosition(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -694,7 +698,7 @@ FX_BOOL Field::buttonPosition(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_BUTTONPOSITION, nVP);
|
| } else {
|
| - Field::SetButtonPosition(m_pDocument.Get(), m_FieldName,
|
| + Field::SetButtonPosition(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, nVP);
|
| }
|
| } else {
|
| @@ -715,7 +719,7 @@ FX_BOOL Field::buttonPosition(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetButtonPosition(CPDFSDK_Document* pDocument,
|
| +void Field::SetButtonPosition(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -725,7 +729,7 @@ void Field::SetButtonPosition(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::buttonScaleHow(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -737,7 +741,7 @@ FX_BOOL Field::buttonScaleHow(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_BUTTONSCALEHOW, nVP);
|
| } else {
|
| - Field::SetButtonScaleHow(m_pDocument.Get(), m_FieldName,
|
| + Field::SetButtonScaleHow(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, nVP);
|
| }
|
| } else {
|
| @@ -763,7 +767,7 @@ FX_BOOL Field::buttonScaleHow(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument,
|
| +void Field::SetButtonScaleHow(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -773,7 +777,7 @@ void Field::SetButtonScaleHow(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::buttonScaleWhen(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -785,7 +789,7 @@ FX_BOOL Field::buttonScaleWhen(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_BUTTONSCALEWHEN, nVP);
|
| } else {
|
| - Field::SetButtonScaleWhen(m_pDocument.Get(), m_FieldName,
|
| + Field::SetButtonScaleWhen(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, nVP);
|
| }
|
| } else {
|
| @@ -822,7 +826,7 @@ FX_BOOL Field::buttonScaleWhen(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument,
|
| +void Field::SetButtonScaleWhen(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -832,7 +836,7 @@ void Field::SetButtonScaleWhen(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::calcOrderIndex(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -844,7 +848,7 @@ FX_BOOL Field::calcOrderIndex(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_CALCORDERINDEX, nVP);
|
| } else {
|
| - Field::SetCalcOrderIndex(m_pDocument.Get(), m_FieldName,
|
| + Field::SetCalcOrderIndex(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, nVP);
|
| }
|
| } else {
|
| @@ -858,7 +862,8 @@ FX_BOOL Field::calcOrderIndex(IJS_Context* cc,
|
| return FALSE;
|
| }
|
|
|
| - CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pRDInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDF_InterForm* pInterForm = pRDInterForm->GetInterForm();
|
| vp << (int32_t)pInterForm->FindFieldInCalculationOrder(pFormField);
|
| }
|
| @@ -866,7 +871,7 @@ FX_BOOL Field::calcOrderIndex(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument,
|
| +void Field::SetCalcOrderIndex(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -876,7 +881,7 @@ void Field::SetCalcOrderIndex(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::charLimit(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -888,8 +893,8 @@ FX_BOOL Field::charLimit(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_CHARLIMIT, nVP);
|
| } else {
|
| - Field::SetCharLimit(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - nVP);
|
| + Field::SetCharLimit(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, nVP);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -905,7 +910,7 @@ FX_BOOL Field::charLimit(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetCharLimit(CPDFSDK_Document* pDocument,
|
| +void Field::SetCharLimit(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -915,7 +920,7 @@ void Field::SetCharLimit(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::comb(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -927,7 +932,8 @@ FX_BOOL Field::comb(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_COMB, bVP);
|
| } else {
|
| - Field::SetComb(m_pDocument.Get(), m_FieldName, m_nFormControlIndex, bVP);
|
| + Field::SetComb(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| + bVP);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -947,7 +953,7 @@ FX_BOOL Field::comb(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetComb(CPDFSDK_Document* pDocument,
|
| +void Field::SetComb(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| @@ -957,7 +963,7 @@ void Field::SetComb(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::commitOnSelChange(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -969,7 +975,7 @@ FX_BOOL Field::commitOnSelChange(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_COMMITONSELCHANGE, bVP);
|
| } else {
|
| - Field::SetCommitOnSelChange(m_pDocument.Get(), m_FieldName,
|
| + Field::SetCommitOnSelChange(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, bVP);
|
| }
|
| } else {
|
| @@ -992,7 +998,7 @@ FX_BOOL Field::commitOnSelChange(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetCommitOnSelChange(CPDFSDK_Document* pDocument,
|
| +void Field::SetCommitOnSelChange(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| @@ -1028,7 +1034,7 @@ FX_BOOL Field::currentValueIndices(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_WordArray(FP_CURRENTVALUEINDICES, array);
|
| } else {
|
| - Field::SetCurrentValueIndices(m_pDocument.Get(), m_FieldName,
|
| + Field::SetCurrentValueIndices(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, array);
|
| }
|
| } else {
|
| @@ -1059,13 +1065,13 @@ FX_BOOL Field::currentValueIndices(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument,
|
| +void Field::SetCurrentValueIndices(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const std::vector<uint32_t>& array) {
|
| - ASSERT(pDocument);
|
| + ASSERT(pFormFillEnv);
|
| std::vector<CPDF_FormField*> FieldArray =
|
| - GetFormFields(pDocument, swFieldName);
|
| + GetFormFields(pFormFillEnv, swFieldName);
|
|
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| int nFieldType = pFormField->GetFieldType();
|
| @@ -1080,7 +1086,7 @@ void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument,
|
| pFormField->SetItemSelection(array[i], TRUE);
|
| }
|
| }
|
| - UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, TRUE, TRUE);
|
| }
|
| }
|
| }
|
| @@ -1091,7 +1097,7 @@ FX_BOOL Field::defaultStyle(IJS_Context* cc,
|
| return FALSE;
|
| }
|
|
|
| -void Field::SetDefaultStyle(CPDFSDK_Document* pDocument,
|
| +void Field::SetDefaultStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex) {
|
| // Not supported.
|
| @@ -1100,7 +1106,7 @@ void Field::SetDefaultStyle(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::defaultValue(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -1112,7 +1118,7 @@ FX_BOOL Field::defaultValue(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_WideString(FP_DEFAULTVALUE, WideStr);
|
| } else {
|
| - Field::SetDefaultValue(m_pDocument.Get(), m_FieldName,
|
| + Field::SetDefaultValue(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, WideStr);
|
| }
|
| } else {
|
| @@ -1131,7 +1137,7 @@ FX_BOOL Field::defaultValue(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetDefaultValue(CPDFSDK_Document* pDocument,
|
| +void Field::SetDefaultValue(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_WideString& string) {
|
| @@ -1141,7 +1147,7 @@ void Field::SetDefaultValue(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::doNotScroll(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -1153,8 +1159,8 @@ FX_BOOL Field::doNotScroll(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_DONOTSCROLL, bVP);
|
| } else {
|
| - Field::SetDoNotScroll(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - bVP);
|
| + Field::SetDoNotScroll(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, bVP);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -1174,7 +1180,7 @@ FX_BOOL Field::doNotScroll(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetDoNotScroll(CPDFSDK_Document* pDocument,
|
| +void Field::SetDoNotScroll(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| @@ -1184,7 +1190,7 @@ void Field::SetDoNotScroll(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::doNotSpellCheck(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -1251,7 +1257,7 @@ FX_BOOL Field::display(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_DISPLAY, nVP);
|
| } else {
|
| - Field::SetDisplay(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetDisplay(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| nVP);
|
| }
|
| } else {
|
| @@ -1261,7 +1267,8 @@ FX_BOOL Field::display(IJS_Context* cc,
|
|
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| ASSERT(pFormField);
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDFSDK_Widget* pWidget =
|
| pInterForm->GetWidget(GetSmartFieldControl(pFormField), true);
|
| if (!pWidget)
|
| @@ -1287,13 +1294,14 @@ FX_BOOL Field::display(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetDisplay(CPDFSDK_Document* pDocument,
|
| +void Field::SetDisplay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray =
|
| - GetFormFields(pDocument, swFieldName);
|
| + GetFormFields(pFormFillEnv, swFieldName);
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| if (nControlIndex < 0) {
|
| bool bAnySet = false;
|
| @@ -1307,7 +1315,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument,
|
| }
|
|
|
| if (bAnySet)
|
| - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, FALSE, TRUE);
|
| } else {
|
| if (nControlIndex >= pFormField->CountControls())
|
| return;
|
| @@ -1318,7 +1326,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument,
|
|
|
| CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl, true);
|
| if (SetWidgetDisplayStatus(pWidget, number))
|
| - UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
|
| + UpdateFormControl(pFormFillEnv, pFormControl, TRUE, FALSE, TRUE);
|
| }
|
| }
|
| }
|
| @@ -1454,8 +1462,8 @@ FX_BOOL Field::fillColor(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Color(FP_FILLCOLOR, color);
|
| } else {
|
| - Field::SetFillColor(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - color);
|
| + Field::SetFillColor(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, color);
|
| }
|
| } else {
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| @@ -1495,7 +1503,7 @@ FX_BOOL Field::fillColor(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetFillColor(CPDFSDK_Document* pDocument,
|
| +void Field::SetFillColor(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CPWL_Color& color) {
|
| @@ -1515,7 +1523,7 @@ FX_BOOL Field::hidden(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_HIDDEN, bVP);
|
| } else {
|
| - Field::SetHidden(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetHidden(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| bVP);
|
| }
|
| } else {
|
| @@ -1525,7 +1533,8 @@ FX_BOOL Field::hidden(IJS_Context* cc,
|
|
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| ASSERT(pFormField);
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDFSDK_Widget* pWidget =
|
| pInterForm->GetWidget(GetSmartFieldControl(pFormField), false);
|
| if (!pWidget)
|
| @@ -1542,18 +1551,18 @@ FX_BOOL Field::hidden(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetHidden(CPDFSDK_Document* pDocument,
|
| +void Field::SetHidden(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| int display = b ? 1 /*Hidden*/ : 0 /*Visible*/;
|
| - SetDisplay(pDocument, swFieldName, nControlIndex, display);
|
| + SetDisplay(pFormFillEnv, swFieldName, nControlIndex, display);
|
| }
|
|
|
| FX_BOOL Field::highlight(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -1565,8 +1574,8 @@ FX_BOOL Field::highlight(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_String(FP_HIGHLIGHT, strMode);
|
| } else {
|
| - Field::SetHighlight(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - strMode);
|
| + Field::SetHighlight(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, strMode);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -1604,7 +1613,7 @@ FX_BOOL Field::highlight(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetHighlight(CPDFSDK_Document* pDocument,
|
| +void Field::SetHighlight(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_ByteString& string) {
|
| @@ -1624,8 +1633,8 @@ FX_BOOL Field::lineWidth(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_LINEWIDTH, iWidth);
|
| } else {
|
| - Field::SetLineWidth(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - iWidth);
|
| + Field::SetLineWidth(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, iWidth);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -1638,7 +1647,8 @@ FX_BOOL Field::lineWidth(IJS_Context* cc,
|
| if (!pFormControl)
|
| return FALSE;
|
|
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| if (!pFormField->CountControls())
|
| return FALSE;
|
|
|
| @@ -1653,13 +1663,14 @@ FX_BOOL Field::lineWidth(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetLineWidth(CPDFSDK_Document* pDocument,
|
| +void Field::SetLineWidth(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray =
|
| - GetFormFields(pDocument, swFieldName);
|
| + GetFormFields(pFormFillEnv, swFieldName);
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| if (nControlIndex < 0) {
|
| FX_BOOL bSet = FALSE;
|
| @@ -1676,7 +1687,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument,
|
| }
|
| }
|
| if (bSet)
|
| - UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, TRUE, TRUE);
|
| } else {
|
| if (nControlIndex >= pFormField->CountControls())
|
| return;
|
| @@ -1686,7 +1697,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument,
|
| pInterForm->GetWidget(pFormControl, false)) {
|
| if (number != pWidget->GetBorderWidth()) {
|
| pWidget->SetBorderWidth(number);
|
| - UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
|
| + UpdateFormControl(pFormFillEnv, pFormControl, TRUE, TRUE, TRUE);
|
| }
|
| }
|
| }
|
| @@ -1697,7 +1708,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::multiline(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -1709,8 +1720,8 @@ FX_BOOL Field::multiline(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_MULTILINE, bVP);
|
| } else {
|
| - Field::SetMultiline(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - bVP);
|
| + Field::SetMultiline(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, bVP);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -1730,7 +1741,7 @@ FX_BOOL Field::multiline(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetMultiline(CPDFSDK_Document* pDocument,
|
| +void Field::SetMultiline(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| @@ -1740,7 +1751,7 @@ void Field::SetMultiline(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::multipleSelection(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -1752,7 +1763,7 @@ FX_BOOL Field::multipleSelection(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_MULTIPLESELECTION, bVP);
|
| } else {
|
| - Field::SetMultipleSelection(m_pDocument.Get(), m_FieldName,
|
| + Field::SetMultipleSelection(m_pFormFillEnv.Get(), m_FieldName,
|
| m_nFormControlIndex, bVP);
|
| }
|
| } else {
|
| @@ -1773,7 +1784,7 @@ FX_BOOL Field::multipleSelection(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetMultipleSelection(CPDFSDK_Document* pDocument,
|
| +void Field::SetMultipleSelection(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| @@ -1830,7 +1841,8 @@ FX_BOOL Field::page(IJS_Context* cc,
|
| return FALSE;
|
|
|
| std::vector<CPDFSDK_Widget*> widgets;
|
| - m_pDocument->GetInterForm()->GetWidgets(pFormField, &widgets);
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm()->GetWidgets(pFormField,
|
| + &widgets);
|
|
|
| if (widgets.empty()) {
|
| vp << (int32_t)-1;
|
| @@ -1855,7 +1867,7 @@ FX_BOOL Field::page(IJS_Context* cc,
|
| FX_BOOL Field::password(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -1867,7 +1879,7 @@ FX_BOOL Field::password(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Bool(FP_PASSWORD, bVP);
|
| } else {
|
| - Field::SetPassword(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetPassword(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| bVP);
|
| }
|
| } else {
|
| @@ -1888,7 +1900,7 @@ FX_BOOL Field::password(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetPassword(CPDFSDK_Document* pDocument,
|
| +void Field::SetPassword(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| bool b) {
|
| @@ -1898,7 +1910,8 @@ void Field::SetPassword(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::print(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| if (FieldArray.empty())
|
| return FALSE;
|
| @@ -1930,7 +1943,7 @@ FX_BOOL Field::print(IJS_Context* cc,
|
| }
|
|
|
| if (bSet)
|
| - UpdateFormField(m_pDocument.Get(), pFormField, TRUE, FALSE, TRUE);
|
| + UpdateFormField(m_pFormFillEnv.Get(), pFormField, TRUE, FALSE, TRUE);
|
| } else {
|
| if (m_nFormControlIndex >= pFormField->CountControls())
|
| return FALSE;
|
| @@ -1946,7 +1959,7 @@ FX_BOOL Field::print(IJS_Context* cc,
|
|
|
| if (dwFlags != pWidget->GetFlags()) {
|
| pWidget->SetFlags(dwFlags);
|
| - UpdateFormControl(m_pDocument.Get(),
|
| + UpdateFormControl(m_pFormFillEnv.Get(),
|
| pFormField->GetControl(m_nFormControlIndex),
|
| TRUE, FALSE, TRUE);
|
| }
|
| @@ -2055,7 +2068,7 @@ FX_BOOL Field::rect(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Rect(FP_RECT, crRect);
|
| } else {
|
| - Field::SetRect(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetRect(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| crRect);
|
| }
|
| } else {
|
| @@ -2064,7 +2077,8 @@ FX_BOOL Field::rect(IJS_Context* cc,
|
| return FALSE;
|
|
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDFSDK_Widget* pWidget =
|
| pInterForm->GetWidget(GetSmartFieldControl(pFormField), true);
|
| if (!pWidget)
|
| @@ -2086,13 +2100,14 @@ FX_BOOL Field::rect(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetRect(CPDFSDK_Document* pDocument,
|
| +void Field::SetRect(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_FloatRect& rect) {
|
| - CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| std::vector<CPDF_FormField*> FieldArray =
|
| - GetFormFields(pDocument, swFieldName);
|
| + GetFormFields(pFormFillEnv, swFieldName);
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| if (nControlIndex < 0) {
|
| FX_BOOL bSet = FALSE;
|
| @@ -2119,7 +2134,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument,
|
| }
|
|
|
| if (bSet)
|
| - UpdateFormField(pDocument, pFormField, TRUE, TRUE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, TRUE, TRUE);
|
| } else {
|
| if (nControlIndex >= pFormField->CountControls())
|
| return;
|
| @@ -2137,7 +2152,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument,
|
| if (crRect.left != rcOld.left || crRect.right != rcOld.right ||
|
| crRect.top != rcOld.top || crRect.bottom != rcOld.bottom) {
|
| pWidget->SetRect(crRect);
|
| - UpdateFormControl(pDocument, pFormControl, TRUE, TRUE, TRUE);
|
| + UpdateFormControl(pFormFillEnv, pFormControl, TRUE, TRUE, TRUE);
|
| }
|
| }
|
| }
|
| @@ -2177,7 +2192,7 @@ FX_BOOL Field::required(IJS_Context* cc,
|
| FX_BOOL Field::richText(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -2216,7 +2231,7 @@ FX_BOOL Field::richValue(IJS_Context* cc,
|
| FX_BOOL Field::rotation(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -2228,7 +2243,7 @@ FX_BOOL Field::rotation(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_ROTATION, nVP);
|
| } else {
|
| - Field::SetRotation(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetRotation(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| nVP);
|
| }
|
| } else {
|
| @@ -2247,7 +2262,7 @@ FX_BOOL Field::rotation(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetRotation(CPDFSDK_Document* pDocument,
|
| +void Field::SetRotation(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -2275,8 +2290,8 @@ FX_BOOL Field::strokeColor(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Color(FP_STROKECOLOR, color);
|
| } else {
|
| - Field::SetStrokeColor(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - color);
|
| + Field::SetStrokeColor(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, color);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -2317,7 +2332,7 @@ FX_BOOL Field::strokeColor(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetStrokeColor(CPDFSDK_Document* pDocument,
|
| +void Field::SetStrokeColor(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CPWL_Color& color) {
|
| @@ -2327,7 +2342,7 @@ void Field::SetStrokeColor(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::style(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -2339,7 +2354,7 @@ FX_BOOL Field::style(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_String(FP_STYLE, csBCaption);
|
| } else {
|
| - Field::SetStyle(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetStyle(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| csBCaption);
|
| }
|
| } else {
|
| @@ -2386,7 +2401,7 @@ FX_BOOL Field::style(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetStyle(CPDFSDK_Document* pDocument,
|
| +void Field::SetStyle(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_ByteString& string) {
|
| @@ -2420,8 +2435,8 @@ FX_BOOL Field::textColor(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Color(FP_TEXTCOLOR, color);
|
| } else {
|
| - Field::SetTextColor(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| - color);
|
| + Field::SetTextColor(m_pFormFillEnv.Get(), m_FieldName,
|
| + m_nFormControlIndex, color);
|
| }
|
| } else {
|
| std::vector<CPDF_FormField*> FieldArray = GetFormFields(m_FieldName);
|
| @@ -2453,7 +2468,7 @@ FX_BOOL Field::textColor(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetTextColor(CPDFSDK_Document* pDocument,
|
| +void Field::SetTextColor(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CPWL_Color& color) {
|
| @@ -2463,7 +2478,7 @@ void Field::SetTextColor(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::textFont(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -2477,7 +2492,7 @@ FX_BOOL Field::textFont(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_String(FP_TEXTFONT, csFontName);
|
| } else {
|
| - Field::SetTextFont(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetTextFont(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| csFontName);
|
| }
|
| } else {
|
| @@ -2509,7 +2524,7 @@ FX_BOOL Field::textFont(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetTextFont(CPDFSDK_Document* pDocument,
|
| +void Field::SetTextFont(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_ByteString& string) {
|
| @@ -2519,7 +2534,7 @@ void Field::SetTextFont(CPDFSDK_Document* pDocument,
|
| FX_BOOL Field::textSize(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -2531,7 +2546,7 @@ FX_BOOL Field::textSize(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_Int(FP_TEXTSIZE, nVP);
|
| } else {
|
| - Field::SetTextSize(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetTextSize(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| nVP);
|
| }
|
| } else {
|
| @@ -2558,7 +2573,7 @@ FX_BOOL Field::textSize(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetTextSize(CPDFSDK_Document* pDocument,
|
| +void Field::SetTextSize(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| int number) {
|
| @@ -2612,7 +2627,7 @@ FX_BOOL Field::type(IJS_Context* cc,
|
| FX_BOOL Field::userName(IJS_Context* cc,
|
| CJS_PropValue& vp,
|
| CFX_WideString& sError) {
|
| - ASSERT(m_pDocument);
|
| + ASSERT(m_pFormFillEnv);
|
|
|
| if (vp.IsSetting()) {
|
| if (!m_bCanSet)
|
| @@ -2624,7 +2639,7 @@ FX_BOOL Field::userName(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_WideString(FP_USERNAME, swName);
|
| } else {
|
| - Field::SetUserName(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetUserName(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| swName);
|
| }
|
| } else {
|
| @@ -2639,7 +2654,7 @@ FX_BOOL Field::userName(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetUserName(CPDFSDK_Document* pDocument,
|
| +void Field::SetUserName(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const CFX_WideString& string) {
|
| @@ -2673,7 +2688,7 @@ FX_BOOL Field::value(IJS_Context* cc,
|
| if (m_bDelay) {
|
| AddDelay_WideStringArray(FP_VALUE, strArray);
|
| } else {
|
| - Field::SetValue(m_pDocument.Get(), m_FieldName, m_nFormControlIndex,
|
| + Field::SetValue(m_pFormFillEnv.Get(), m_FieldName, m_nFormControlIndex,
|
| strArray);
|
| }
|
| } else {
|
| @@ -2732,16 +2747,16 @@ FX_BOOL Field::value(IJS_Context* cc,
|
| return TRUE;
|
| }
|
|
|
| -void Field::SetValue(CPDFSDK_Document* pDocument,
|
| +void Field::SetValue(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| const CFX_WideString& swFieldName,
|
| int nControlIndex,
|
| const std::vector<CFX_WideString>& strArray) {
|
| - ASSERT(pDocument);
|
| + ASSERT(pFormFillEnv);
|
| if (strArray.empty())
|
| return;
|
|
|
| std::vector<CPDF_FormField*> FieldArray =
|
| - GetFormFields(pDocument, swFieldName);
|
| + GetFormFields(pFormFillEnv, swFieldName);
|
|
|
| for (CPDF_FormField* pFormField : FieldArray) {
|
| if (pFormField->GetFullName().Compare(swFieldName) != 0)
|
| @@ -2752,14 +2767,14 @@ void Field::SetValue(CPDFSDK_Document* pDocument,
|
| case FIELDTYPE_COMBOBOX:
|
| if (pFormField->GetValue() != strArray[0]) {
|
| pFormField->SetValue(strArray[0], TRUE);
|
| - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, FALSE, TRUE);
|
| }
|
| break;
|
| case FIELDTYPE_CHECKBOX:
|
| case FIELDTYPE_RADIOBUTTON: {
|
| if (pFormField->GetValue() != strArray[0]) {
|
| pFormField->SetValue(strArray[0], TRUE);
|
| - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, FALSE, TRUE);
|
| }
|
| } break;
|
| case FIELDTYPE_LISTBOX: {
|
| @@ -2777,7 +2792,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument,
|
| if (!pFormField->IsItemSelected(index))
|
| pFormField->SetItemSelection(index, TRUE, TRUE);
|
| }
|
| - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
|
| + UpdateFormField(pFormFillEnv, pFormField, TRUE, FALSE, TRUE);
|
| }
|
| } break;
|
| default:
|
| @@ -2837,13 +2852,12 @@ FX_BOOL Field::browseForFileToSubmit(IJS_Context* cc,
|
| return FALSE;
|
|
|
| CPDF_FormField* pFormField = FieldArray[0];
|
| - CPDFSDK_FormFillEnvironment* pApp = m_pDocument->GetEnv();
|
| if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) &&
|
| (pFormField->GetFieldType() == FIELDTYPE_TEXTFIELD)) {
|
| - CFX_WideString wsFileName = pApp->JS_fieldBrowse();
|
| + CFX_WideString wsFileName = m_pFormFillEnv->JS_fieldBrowse();
|
| if (!wsFileName.IsEmpty()) {
|
| pFormField->SetValue(wsFileName);
|
| - UpdateFormField(m_pDocument.Get(), pFormField, TRUE, TRUE, TRUE);
|
| + UpdateFormField(m_pFormFillEnv.Get(), pFormField, TRUE, TRUE, TRUE);
|
| }
|
| return TRUE;
|
| }
|
| @@ -2987,7 +3001,7 @@ FX_BOOL Field::checkThisBox(IJS_Context* cc,
|
| else
|
| pFormField->CheckControl(nWidget, bCheckit, true);
|
|
|
| - UpdateFormField(m_pDocument.Get(), pFormField, TRUE, TRUE, TRUE);
|
| + UpdateFormField(m_pFormFillEnv.Get(), pFormField, TRUE, TRUE, TRUE);
|
| return TRUE;
|
| }
|
|
|
| @@ -3199,18 +3213,19 @@ FX_BOOL Field::setFocus(IJS_Context* cc,
|
| if (nCount < 1)
|
| return FALSE;
|
|
|
| - CPDFSDK_InterForm* pInterForm = m_pDocument->GetInterForm();
|
| + CPDFSDK_InterForm* pInterForm =
|
| + m_pFormFillEnv->GetSDKDocument()->GetInterForm();
|
| CPDFSDK_Widget* pWidget = nullptr;
|
| if (nCount == 1) {
|
| pWidget = pInterForm->GetWidget(pFormField->GetControl(0), false);
|
| } else {
|
| - CPDFSDK_FormFillEnvironment* pEnv = m_pDocument->GetEnv();
|
| - UnderlyingPageType* pPage = UnderlyingFromFPDFPage(
|
| - pEnv->GetCurrentPage(m_pDocument->GetUnderlyingDocument()));
|
| + UnderlyingPageType* pPage =
|
| + UnderlyingFromFPDFPage(m_pFormFillEnv->GetCurrentPage(
|
| + m_pFormFillEnv->GetUnderlyingDocument()));
|
| if (!pPage)
|
| return FALSE;
|
| if (CPDFSDK_PageView* pCurPageView =
|
| - m_pDocument->GetPageView(pPage, true)) {
|
| + m_pFormFillEnv->GetSDKDocument()->GetPageView(pPage, true)) {
|
| for (int32_t i = 0; i < nCount; i++) {
|
| if (CPDFSDK_Widget* pTempWidget =
|
| pInterForm->GetWidget(pFormField->GetControl(i), false)) {
|
| @@ -3225,7 +3240,7 @@ FX_BOOL Field::setFocus(IJS_Context* cc,
|
|
|
| if (pWidget) {
|
| CPDFSDK_Annot::ObservedPtr pObserved(pWidget);
|
| - m_pDocument->SetFocusAnnot(&pObserved);
|
| + m_pFormFillEnv->GetSDKDocument()->SetFocusAnnot(&pObserved);
|
| }
|
|
|
| return TRUE;
|
| @@ -3355,103 +3370,104 @@ void Field::AddDelay_WideStringArray(FIELD_PROP prop,
|
| m_pJSDoc->AddDelayData(pNewData);
|
| }
|
|
|
| -void Field::DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData) {
|
| - ASSERT(pDocument);
|
| +void Field::DoDelay(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| + CJS_DelayData* pData) {
|
| + ASSERT(pFormFillEnv);
|
| switch (pData->eProp) {
|
| case FP_ALIGNMENT:
|
| - Field::SetAlignment(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetAlignment(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->string);
|
| break;
|
| case FP_BORDERSTYLE:
|
| - Field::SetBorderStyle(pDocument, pData->sFieldName, pData->nControlIndex,
|
| - pData->string);
|
| + Field::SetBorderStyle(pFormFillEnv, pData->sFieldName,
|
| + pData->nControlIndex, pData->string);
|
| break;
|
| case FP_BUTTONALIGNX:
|
| - Field::SetButtonAlignX(pDocument, pData->sFieldName, pData->nControlIndex,
|
| - pData->num);
|
| + Field::SetButtonAlignX(pFormFillEnv, pData->sFieldName,
|
| + pData->nControlIndex, pData->num);
|
| break;
|
| case FP_BUTTONALIGNY:
|
| - Field::SetButtonAlignY(pDocument, pData->sFieldName, pData->nControlIndex,
|
| - pData->num);
|
| + Field::SetButtonAlignY(pFormFillEnv, pData->sFieldName,
|
| + pData->nControlIndex, pData->num);
|
| break;
|
| case FP_BUTTONFITBOUNDS:
|
| - Field::SetButtonFitBounds(pDocument, pData->sFieldName,
|
| + Field::SetButtonFitBounds(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->b);
|
| break;
|
| case FP_BUTTONPOSITION:
|
| - Field::SetButtonPosition(pDocument, pData->sFieldName,
|
| + Field::SetButtonPosition(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->num);
|
| break;
|
| case FP_BUTTONSCALEHOW:
|
| - Field::SetButtonScaleHow(pDocument, pData->sFieldName,
|
| + Field::SetButtonScaleHow(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->num);
|
| break;
|
| case FP_BUTTONSCALEWHEN:
|
| - Field::SetButtonScaleWhen(pDocument, pData->sFieldName,
|
| + Field::SetButtonScaleWhen(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->num);
|
| break;
|
| case FP_CALCORDERINDEX:
|
| - Field::SetCalcOrderIndex(pDocument, pData->sFieldName,
|
| + Field::SetCalcOrderIndex(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->num);
|
| break;
|
| case FP_CHARLIMIT:
|
| - Field::SetCharLimit(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetCharLimit(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->num);
|
| break;
|
| case FP_COMB:
|
| - Field::SetComb(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetComb(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->b);
|
| break;
|
| case FP_COMMITONSELCHANGE:
|
| - Field::SetCommitOnSelChange(pDocument, pData->sFieldName,
|
| + Field::SetCommitOnSelChange(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->b);
|
| break;
|
| case FP_CURRENTVALUEINDICES:
|
| - Field::SetCurrentValueIndices(pDocument, pData->sFieldName,
|
| + Field::SetCurrentValueIndices(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->wordarray);
|
| break;
|
| case FP_DEFAULTVALUE:
|
| - Field::SetDefaultValue(pDocument, pData->sFieldName, pData->nControlIndex,
|
| - pData->widestring);
|
| + Field::SetDefaultValue(pFormFillEnv, pData->sFieldName,
|
| + pData->nControlIndex, pData->widestring);
|
| break;
|
| case FP_DONOTSCROLL:
|
| - Field::SetDoNotScroll(pDocument, pData->sFieldName, pData->nControlIndex,
|
| - pData->b);
|
| + Field::SetDoNotScroll(pFormFillEnv, pData->sFieldName,
|
| + pData->nControlIndex, pData->b);
|
| break;
|
| case FP_DISPLAY:
|
| - Field::SetDisplay(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetDisplay(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->num);
|
| break;
|
| case FP_FILLCOLOR:
|
| - Field::SetFillColor(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetFillColor(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->color);
|
| break;
|
| case FP_HIDDEN:
|
| - Field::SetHidden(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetHidden(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->b);
|
| break;
|
| case FP_HIGHLIGHT:
|
| - Field::SetHighlight(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetHighlight(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->string);
|
| break;
|
| case FP_LINEWIDTH:
|
| - Field::SetLineWidth(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetLineWidth(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->num);
|
| break;
|
| case FP_MULTILINE:
|
| - Field::SetMultiline(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetMultiline(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->b);
|
| break;
|
| case FP_MULTIPLESELECTION:
|
| - Field::SetMultipleSelection(pDocument, pData->sFieldName,
|
| + Field::SetMultipleSelection(pFormFillEnv, pData->sFieldName,
|
| pData->nControlIndex, pData->b);
|
| break;
|
| case FP_PASSWORD:
|
| - Field::SetPassword(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetPassword(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->b);
|
| break;
|
| case FP_RECT:
|
| - Field::SetRect(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetRect(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->rect);
|
| break;
|
| case FP_RICHTEXT:
|
| @@ -3460,41 +3476,41 @@ void Field::DoDelay(CPDFSDK_Document* pDocument, CJS_DelayData* pData) {
|
| case FP_RICHVALUE:
|
| break;
|
| case FP_ROTATION:
|
| - Field::SetRotation(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetRotation(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->num);
|
| break;
|
| case FP_STROKECOLOR:
|
| - Field::SetStrokeColor(pDocument, pData->sFieldName, pData->nControlIndex,
|
| - pData->color);
|
| + Field::SetStrokeColor(pFormFillEnv, pData->sFieldName,
|
| + pData->nControlIndex, pData->color);
|
| break;
|
| case FP_STYLE:
|
| - Field::SetStyle(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetStyle(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->string);
|
| break;
|
| case FP_TEXTCOLOR:
|
| - Field::SetTextColor(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetTextColor(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->color);
|
| break;
|
| case FP_TEXTFONT:
|
| - Field::SetTextFont(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetTextFont(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->string);
|
| break;
|
| case FP_TEXTSIZE:
|
| - Field::SetTextSize(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetTextSize(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->num);
|
| break;
|
| case FP_USERNAME:
|
| - Field::SetUserName(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetUserName(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->widestring);
|
| break;
|
| case FP_VALUE:
|
| - Field::SetValue(pDocument, pData->sFieldName, pData->nControlIndex,
|
| + Field::SetValue(pFormFillEnv, pData->sFieldName, pData->nControlIndex,
|
| pData->widestringarray);
|
| break;
|
| }
|
| }
|
|
|
| -void Field::AddField(CPDFSDK_Document* pDocument,
|
| +void Field::AddField(CPDFSDK_FormFillEnvironment* pFormFillEnv,
|
| int nPageIndex,
|
| int nFieldType,
|
| const CFX_WideString& sName,
|
|
|