From aeb5246e6293a5d25973405f5602c46aa81f7dfd Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 4 Dec 2017 19:02:16 +0000 Subject: Remove CXFA_ValueArray This CL removes the CXFA_ValueArray. Some of the code in XFA_RESOLVENODE_RS is duplicated, but the duplication makes the code clearer. Change-Id: I7495bb8c614a3d8919bfca858866932774f13fd8 Reviewed-on: https://pdfium-review.googlesource.com/20350 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_valuearray.cpp | 25 ------------------------- xfa/fxfa/parser/cxfa_valuearray.h | 29 ----------------------------- xfa/fxfa/parser/xfa_resolvenode_rs.h | 15 --------------- 3 files changed, 69 deletions(-) delete mode 100644 xfa/fxfa/parser/cxfa_valuearray.cpp delete mode 100644 xfa/fxfa/parser/cxfa_valuearray.h (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/parser/cxfa_valuearray.cpp b/xfa/fxfa/parser/cxfa_valuearray.cpp deleted file mode 100644 index 83ffe6b275..0000000000 --- a/xfa/fxfa/parser/cxfa_valuearray.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#include "xfa/fxfa/parser/cxfa_valuearray.h" - -#include - -#include "fxjs/cfxjse_engine.h" - -CXFA_ValueArray::CXFA_ValueArray(v8::Isolate* pIsolate) - : m_pIsolate(pIsolate) {} - -CXFA_ValueArray::~CXFA_ValueArray() {} - -std::vector CXFA_ValueArray::GetAttributeObject() { - std::vector result(m_Values.size()); - std::transform(m_Values.begin(), m_Values.end(), result.begin(), - [](const std::unique_ptr& value) { - return CFXJSE_Engine::ToObject(value.get(), nullptr); - }); - return result; -} diff --git a/xfa/fxfa/parser/cxfa_valuearray.h b/xfa/fxfa/parser/cxfa_valuearray.h deleted file mode 100644 index c6054e2fbf..0000000000 --- a/xfa/fxfa/parser/cxfa_valuearray.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2016 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef XFA_FXFA_PARSER_CXFA_VALUEARRAY_H_ -#define XFA_FXFA_PARSER_CXFA_VALUEARRAY_H_ - -#include -#include - -#include "fxjs/cfxjse_value.h" -#include "xfa/fxfa/fxfa.h" - -class CXFA_Object; - -class CXFA_ValueArray { - public: - explicit CXFA_ValueArray(v8::Isolate* pIsolate); - ~CXFA_ValueArray(); - - std::vector GetAttributeObject(); - - v8::Isolate* const m_pIsolate; - std::vector> m_Values; -}; - -#endif // XFA_FXFA_PARSER_CXFA_VALUEARRAY_H_ diff --git a/xfa/fxfa/parser/xfa_resolvenode_rs.h b/xfa/fxfa/parser/xfa_resolvenode_rs.h index c5cdeee06f..2eaab5dff4 100644 --- a/xfa/fxfa/parser/xfa_resolvenode_rs.h +++ b/xfa/fxfa/parser/xfa_resolvenode_rs.h @@ -15,7 +15,6 @@ #include "third_party/base/ptr_util.h" #include "xfa/fxfa/fxfa.h" #include "xfa/fxfa/parser/cxfa_object.h" -#include "xfa/fxfa/parser/cxfa_valuearray.h" #define XFA_RESOLVENODE_Children 0x0001 #define XFA_RESOLVENODE_Attributes 0x0004 @@ -41,20 +40,6 @@ struct XFA_RESOLVENODE_RS { XFA_RESOLVENODE_RS(); ~XFA_RESOLVENODE_RS(); - size_t GetAttributeResult(CXFA_ValueArray* valueArray) const { - if (pScriptAttribute && - pScriptAttribute->eValueType == XFA_ScriptType::Object) { - for (CXFA_Object* pObject : objects) { - auto pValue = pdfium::MakeUnique(valueArray->m_pIsolate); - CJX_Object* jsObject = pObject->JSObject(); - (jsObject->*(pScriptAttribute->callback))(pValue.get(), false, - pScriptAttribute->attribute); - valueArray->m_Values.push_back(std::move(pValue)); - } - } - return valueArray->m_Values.size(); - } - std::vector objects; // Not owned. XFA_RESOLVENODE_RSTYPE dwFlags; const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute; -- cgit v1.2.3