diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-07-25 16:59:38 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-25 16:59:38 +0000 |
commit | 1f7db295b1deeecb562d6213b3ea17b9168405eb (patch) | |
tree | 9e8ab0575b9acd207e8bcf8a7273aa2a4d0948bb /xfa/fxfa/parser/cxfa_object.cpp | |
parent | 84d3394d88c42b798eedc938e6295ad1bf28ac66 (diff) | |
download | pdfium-1f7db295b1deeecb562d6213b3ea17b9168405eb.tar.xz |
Move CXFA_ThisProxy helper to CXFA_Object.
Because the other helpers are declared here.
Rename VariablesThis to ThisProxy in a few places; VariablesThis is
a slightly different concept (see GetVariablesThis()).
Then introduce helper for CXFA_List subclass as well.
Remove unused const version of some helpers.
Change-Id: Ia328d8cd170a8b97015e98c1c770fa8a44810455
Reviewed-on: https://pdfium-review.googlesource.com/38670
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_object.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_object.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp index 920e33860e..6daf3aa7b4 100644 --- a/xfa/fxfa/parser/cxfa_object.cpp +++ b/xfa/fxfa/parser/cxfa_object.cpp @@ -15,6 +15,7 @@ #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_thisproxy.h" #include "xfa/fxfa/parser/cxfa_treelist.h" CXFA_Object::CXFA_Object(CXFA_Document* pDocument, @@ -43,6 +44,10 @@ WideString CXFA_Object::GetSOMExpression() { return pScriptContext->GetSomExpression(ToNode(this)); } +CXFA_List* CXFA_Object::AsList() { + return IsList() ? static_cast<CXFA_List*>(this) : nullptr; +} + CXFA_Node* CXFA_Object::AsNode() { return IsNode() ? static_cast<CXFA_Node*>(this) : nullptr; } @@ -51,18 +56,22 @@ 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; +CXFA_ThisProxy* CXFA_Object::AsThisProxy() { + return IsThisProxy() ? static_cast<CXFA_ThisProxy*>(this) : nullptr; } -const CXFA_TreeList* CXFA_Object::AsTreeList() const { - return IsTreeList() ? static_cast<const CXFA_TreeList*>(this) : nullptr; +CXFA_List* ToList(CXFA_Object* pObj) { + return pObj ? pObj->AsList() : nullptr; } CXFA_Node* ToNode(CXFA_Object* pObj) { return pObj ? pObj->AsNode() : nullptr; } -const CXFA_Node* ToNode(const CXFA_Object* pObj) { - return pObj ? pObj->AsNode() : nullptr; +CXFA_TreeList* ToTreeList(CXFA_Object* pObj) { + return pObj ? pObj->AsTreeList() : nullptr; +} + +CXFA_ThisProxy* ToThisProxy(CXFA_Object* pObj) { + return pObj ? pObj->AsThisProxy() : nullptr; } |