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