diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-12-07 22:33:43 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-07 22:33:43 +0000 |
commit | 93bb725b62f9779534c9444c1e1319fe8c28912e (patch) | |
tree | af0c758c1129dc076cbf67a89f1c23e4703e02bd /xfa/fxfa/parser/cxfa_object.cpp | |
parent | ce6979f8d064507300fe0b3a856687fb958c9a5c (diff) | |
download | pdfium-93bb725b62f9779534c9444c1e1319fe8c28912e.tar.xz |
[xfa] Move JS method information to files.chromium/3288
This CL moves the XFA SOM JS Method information out of the c-array and
into individual CJX class files.
Change-Id: I401046a06aacaf1f04e5a51eb899e479de012e15
Reviewed-on: https://pdfium-review.googlesource.com/20450
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_object.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_object.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp index 7823015695..93d31244f6 100644 --- a/xfa/fxfa/parser/cxfa_object.cpp +++ b/xfa/fxfa/parser/cxfa_object.cpp @@ -9,11 +9,12 @@ #include <utility> #include "core/fxcrt/fx_extension.h" +#include "fxjs/cfxjse_engine.h" #include "fxjs/cfxjse_value.h" #include "xfa/fxfa/cxfa_ffnotify.h" #include "xfa/fxfa/parser/cxfa_document.h" #include "xfa/fxfa/parser/cxfa_node.h" -#include "xfa/fxfa/parser/cxfa_nodelist.h" +#include "xfa/fxfa/parser/cxfa_treelist.h" CXFA_Object::CXFA_Object(CXFA_Document* pDocument, XFA_ObjectType objectType, @@ -30,20 +31,28 @@ CXFA_Object::CXFA_Object(CXFA_Document* pDocument, CXFA_Object::~CXFA_Object() {} +void CXFA_Object::GetSOMExpression(WideString& wsSOMExpression) { + CFXJSE_Engine* pScriptContext = m_pDocument->GetScriptContext(); + if (!pScriptContext) + return; + + pScriptContext->GetSomExpression(ToNode(this), wsSOMExpression); +} + CXFA_Node* CXFA_Object::AsNode() { return IsNode() ? static_cast<CXFA_Node*>(this) : nullptr; } -CXFA_NodeList* CXFA_Object::AsNodeList() { - return IsNodeList() ? static_cast<CXFA_NodeList*>(this) : nullptr; +CXFA_TreeList* CXFA_Object::AsTreeList() { + return IsTreeList() ? static_cast<CXFA_TreeList*>(this) : nullptr; } const CXFA_Node* CXFA_Object::AsNode() const { return IsNode() ? static_cast<const CXFA_Node*>(this) : nullptr; } -const CXFA_NodeList* CXFA_Object::AsNodeList() const { - return IsNodeList() ? static_cast<const CXFA_NodeList*>(this) : nullptr; +const CXFA_TreeList* CXFA_Object::AsTreeList() const { + return IsTreeList() ? static_cast<const CXFA_TreeList*>(this) : nullptr; } CXFA_Node* ToNode(CXFA_Object* pObj) { |