diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-03-14 12:13:22 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 19:59:49 +0000 |
commit | f8a943908a414836271a1b7d7e4a97635d941b7f (patch) | |
tree | 7f900d57e21c72a67a0347e4f25d0784bdad7c83 /xfa/fxfa/parser/xfa_resolvenode_rs.h | |
parent | 05df075154a832fcb476e1dfcfb865722d0ea898 (diff) | |
download | pdfium-f8a943908a414836271a1b7d7e4a97635d941b7f.tar.xz |
Replace CXFA_{Object,Node}Array with std::vector
These two ought to happen at the same time as they are
intertwined in spots. Remove blatant casts between the
two along the way.
Change-Id: I9ce5d2faadf1e38aba7cade316560d24a66d8669
Reviewed-on: https://pdfium-review.googlesource.com/2933
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_resolvenode_rs.h')
-rw-r--r-- | xfa/fxfa/parser/xfa_resolvenode_rs.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/fxfa/parser/xfa_resolvenode_rs.h b/xfa/fxfa/parser/xfa_resolvenode_rs.h index 7ad218efe8..a60ef9a3c6 100644 --- a/xfa/fxfa/parser/xfa_resolvenode_rs.h +++ b/xfa/fxfa/parser/xfa_resolvenode_rs.h @@ -8,8 +8,10 @@ #define XFA_FXFA_PARSER_XFA_RESOLVENODE_RS_H_ #include <memory> +#include <vector> #include "fxjs/cfxjse_value.h" +#include "third_party/base/ptr_util.h" #include "xfa/fxfa/fxfa.h" #include "xfa/fxfa/parser/cxfa_valuearray.h" @@ -45,10 +47,9 @@ struct XFA_RESOLVENODE_RS { int32_t GetAttributeResult(CXFA_ValueArray& valueArray) const { if (pScriptAttribute && pScriptAttribute->eValueType == XFA_SCRIPT_Object) { - v8::Isolate* pIsolate = valueArray.m_pIsolate; - for (int32_t i = 0; i < nodes.GetSize(); i++) { - std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(pIsolate)); - (nodes[i]->*(pScriptAttribute->lpfnCallback))( + for (CXFA_Object* pObject : objects) { + auto pValue = pdfium::MakeUnique<CFXJSE_Value>(valueArray.m_pIsolate); + (pObject->*(pScriptAttribute->lpfnCallback))( pValue.get(), false, (XFA_ATTRIBUTE)pScriptAttribute->eAttribute); valueArray.Add(pValue.release()); } @@ -56,7 +57,7 @@ struct XFA_RESOLVENODE_RS { return valueArray.GetSize(); } - CXFA_ObjArray nodes; + std::vector<CXFA_Object*> objects; // Not owned. XFA_RESOVENODE_RSTYPE dwFlags; const XFA_SCRIPTATTRIBUTEINFO* pScriptAttribute; }; @@ -64,7 +65,6 @@ struct XFA_RESOLVENODE_RS { inline XFA_RESOLVENODE_RS::XFA_RESOLVENODE_RS() : dwFlags(XFA_RESOVENODE_RSTYPE_Nodes), pScriptAttribute(nullptr) {} -inline XFA_RESOLVENODE_RS::~XFA_RESOLVENODE_RS() { - nodes.RemoveAll(); -} +inline XFA_RESOLVENODE_RS::~XFA_RESOLVENODE_RS() {} + #endif // XFA_FXFA_PARSER_XFA_RESOLVENODE_RS_H_ |