summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_object.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-29 14:47:46 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-29 19:25:17 +0000
commitefcae5d85f829618749461617521a076881cc493 (patch)
treec04c722da050231e410e7a79d4562bb6789910c4 /xfa/fxfa/parser/cxfa_object.cpp
parent47b8f070dc11308e0bef3a157f6c70fbcad4093a (diff)
downloadpdfium-efcae5d85f829618749461617521a076881cc493.tar.xz
Split xfa_object.h apart.
This Cl splits the xfa_object.h into individual class header files and fixes the needed includes. Change-Id: Ia011ee9bc5deee5e44b8a956fa54bc2c3849cff0 Reviewed-on: https://pdfium-review.googlesource.com/3254 Reviewed-by: Nicolás Peña <npm@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.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp
index 4964265b4d..9bbee4ec75 100644
--- a/xfa/fxfa/parser/cxfa_object.cpp
+++ b/xfa/fxfa/parser/cxfa_object.cpp
@@ -4,12 +4,14 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "xfa/fxfa/parser/xfa_object.h"
+#include "xfa/fxfa/parser/cxfa_object.h"
#include "core/fxcrt/fx_ext.h"
#include "fxjs/cfxjse_value.h"
#include "xfa/fxfa/app/xfa_ffnotify.h"
#include "xfa/fxfa/parser/cxfa_document.h"
+#include "xfa/fxfa/parser/cxfa_node.h"
+#include "xfa/fxfa/parser/cxfa_nodelist.h"
CXFA_Object::CXFA_Object(CXFA_Document* pDocument,
XFA_ObjectType objectType,
@@ -23,18 +25,6 @@ CXFA_Object::CXFA_Object(CXFA_Document* pDocument,
CXFA_Object::~CXFA_Object() {}
-CFX_WideStringC CXFA_Object::GetClassName() const {
- return m_elementName;
-}
-
-uint32_t CXFA_Object::GetClassHashCode() const {
- return m_elementNameHash;
-}
-
-XFA_Element CXFA_Object::GetElementType() const {
- return m_elementType;
-}
-
void CXFA_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue,
bool bSetting,
XFA_ATTRIBUTE eAttribute) {
@@ -71,3 +61,27 @@ void CXFA_Object::ThrowException(const wchar_t* str, ...) const {
va_end(arg_ptr);
FXJSE_ThrowMessage(wsMessage.UTF8Encode().AsStringC());
}
+
+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;
+}
+
+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;
+}
+
+CXFA_Node* ToNode(CXFA_Object* pObj) {
+ return pObj ? pObj->AsNode() : nullptr;
+}
+
+const CXFA_Node* ToNode(const CXFA_Object* pObj) {
+ return pObj ? pObj->AsNode() : nullptr;
+}