dsinclair | 8f3074b | 2016-06-02 17:45:25 -0700 | [diff] [blame] | 1 | // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | |
| 7 | #include "xfa/fxfa/parser/cxfa_valuearray.h" |
| 8 | |
Tom Sepez | 369fe1f | 2017-03-27 16:03:43 -0700 | [diff] [blame] | 9 | #include <algorithm> |
| 10 | |
dsinclair | 31f8740 | 2016-07-20 06:34:45 -0700 | [diff] [blame] | 11 | #include "xfa/fxfa/parser/cxfa_scriptcontext.h" |
dsinclair | 8f3074b | 2016-06-02 17:45:25 -0700 | [diff] [blame] | 12 | |
| 13 | CXFA_ValueArray::CXFA_ValueArray(v8::Isolate* pIsolate) |
| 14 | : m_pIsolate(pIsolate) {} |
| 15 | |
Tom Sepez | 369fe1f | 2017-03-27 16:03:43 -0700 | [diff] [blame] | 16 | CXFA_ValueArray::~CXFA_ValueArray() {} |
dsinclair | 8f3074b | 2016-06-02 17:45:25 -0700 | [diff] [blame] | 17 | |
Tom Sepez | f8a9439 | 2017-03-14 12:13:22 -0700 | [diff] [blame] | 18 | std::vector<CXFA_Object*> CXFA_ValueArray::GetAttributeObject() { |
Tom Sepez | 369fe1f | 2017-03-27 16:03:43 -0700 | [diff] [blame] | 19 | std::vector<CXFA_Object*> result(m_Values.size()); |
| 20 | std::transform(m_Values.begin(), m_Values.end(), result.begin(), |
| 21 | [](const std::unique_ptr<CFXJSE_Value>& value) { |
| 22 | return CXFA_ScriptContext::ToObject(value.get(), nullptr); |
| 23 | }); |
| 24 | return result; |
dsinclair | 8f3074b | 2016-06-02 17:45:25 -0700 | [diff] [blame] | 25 | } |