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 "Field.h" | 7 #include "Field.h" |
8 | 8 |
9 #include "Document.h" | 9 #include "Document.h" |
10 #include "Icon.h" | 10 #include "Icon.h" |
(...skipping 3122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3133 for (CPDF_FormField* pFormField : FieldArray) | 3133 for (CPDF_FormField* pFormField : FieldArray) |
3134 swSort.Add(new CFX_WideString(pFormField->GetFullName())); | 3134 swSort.Add(new CFX_WideString(pFormField->GetFullName())); |
3135 swSort.Sort(JS_COMPARESTRING); | 3135 swSort.Sort(JS_COMPARESTRING); |
3136 | 3136 |
3137 CJS_Context* pContext = (CJS_Context*)cc; | 3137 CJS_Context* pContext = (CJS_Context*)cc; |
3138 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); | 3138 CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |
3139 ASSERT(pRuntime); | 3139 ASSERT(pRuntime); |
3140 | 3140 |
3141 CJS_Array FormFieldArray(pRuntime); | 3141 CJS_Array FormFieldArray(pRuntime); |
3142 for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) { | 3142 for (int j = 0, jsz = swSort.GetSize(); j < jsz; j++) { |
3143 nonstd::unique_ptr<CFX_WideString> pStr(swSort.GetAt(j)); | 3143 std::unique_ptr<CFX_WideString> pStr(swSort.GetAt(j)); |
3144 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( | 3144 v8::Local<v8::Object> pObj = FXJS_NewFxDynamicObj( |
3145 pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID); | 3145 pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID); |
3146 ASSERT(!pObj.IsEmpty()); | 3146 ASSERT(!pObj.IsEmpty()); |
3147 | 3147 |
3148 CJS_Field* pJSField = | 3148 CJS_Field* pJSField = |
3149 (CJS_Field*)FXJS_GetPrivate(pRuntime->GetIsolate(), pObj); | 3149 (CJS_Field*)FXJS_GetPrivate(pRuntime->GetIsolate(), pObj); |
3150 Field* pField = (Field*)pJSField->GetEmbedObject(); | 3150 Field* pField = (Field*)pJSField->GetEmbedObject(); |
3151 pField->AttachField(m_pJSDoc, *pStr); | 3151 pField->AttachField(m_pJSDoc, *pStr); |
3152 | 3152 |
3153 CJS_Value FormFieldValue(pRuntime); | 3153 CJS_Value FormFieldValue(pRuntime); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3619 } | 3619 } |
3620 } | 3620 } |
3621 | 3621 |
3622 void Field::AddField(CPDFSDK_Document* pDocument, | 3622 void Field::AddField(CPDFSDK_Document* pDocument, |
3623 int nPageIndex, | 3623 int nPageIndex, |
3624 int nFieldType, | 3624 int nFieldType, |
3625 const CFX_WideString& sName, | 3625 const CFX_WideString& sName, |
3626 const CPDF_Rect& rcCoords) { | 3626 const CPDF_Rect& rcCoords) { |
3627 // Not supported. | 3627 // Not supported. |
3628 } | 3628 } |
OLD | NEW |