summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_object_imp.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-16 08:00:06 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-16 08:00:06 -0700
commit47bcd4c5c56cdc2d63a0c2ed4e7f68e6ccf523f6 (patch)
tree90675d8541871a71c6cd9c64723464878bd49a90 /xfa/fxfa/parser/xfa_object_imp.cpp
parentb63068f04681f7ade9c062a442977c660e3503d0 (diff)
downloadpdfium-47bcd4c5c56cdc2d63a0c2ed4e7f68e6ccf523f6.tar.xz
Make code compile with clang_use_chrome_plugin (part V)chromium/2770
This change mainly contains files in xfa/fxfa directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2071683002
Diffstat (limited to 'xfa/fxfa/parser/xfa_object_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_object_imp.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp
index 0f36d68aa6..02617f14b9 100644
--- a/xfa/fxfa/parser/xfa_object_imp.cpp
+++ b/xfa/fxfa/parser/xfa_object_imp.cpp
@@ -59,6 +59,8 @@ XFA_MAPDATABLOCKCALLBACKINFO deleteBindItemCallBack = {
CXFA_Object::CXFA_Object(CXFA_Document* pDocument, uint32_t uFlags)
: m_pDocument(pDocument), m_uFlags(uFlags) {}
+CXFA_Object::~CXFA_Object() {}
+
void CXFA_Object::GetClassName(CFX_WideStringC& wsName) const {
wsName = XFA_GetElementByID(GetClassID())->pName;
}
@@ -107,6 +109,10 @@ void CXFA_Object::ThrowException(int32_t iStringID, ...) {
FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC());
}
+XFA_MAPMODULEDATA::XFA_MAPMODULEDATA() {}
+
+XFA_MAPMODULEDATA::~XFA_MAPMODULEDATA() {}
+
CXFA_Node::CXFA_Node(CXFA_Document* pDoc,
uint16_t ePacket,
XFA_ELEMENT eElement)
@@ -5084,11 +5090,50 @@ void CXFA_Node::MoveBufferMapData(CXFA_Node* pSrcModule,
}
pSrcModule->MoveBufferMapData(pDstModule, pKey);
}
+
+CXFA_OrdinaryObject::CXFA_OrdinaryObject(CXFA_Document* pDocument,
+ XFA_ELEMENT eElement)
+ : CXFA_Object(pDocument, XFA_OBJECTTYPE_OrdinaryObject), m_uScriptHash(0) {
+ m_eNodeClass = eElement;
+}
+
+CXFA_OrdinaryObject::~CXFA_OrdinaryObject() {}
+
+XFA_ELEMENT CXFA_OrdinaryObject::GetClassID() const {
+ return m_eNodeClass;
+}
+
+uint32_t CXFA_OrdinaryObject::GetScriptObjHash() const {
+ return m_uScriptHash;
+}
+
+CXFA_ThisProxy::CXFA_ThisProxy(CXFA_Node* pThisNode, CXFA_Node* pScriptNode)
+ : CXFA_Object(pThisNode->GetDocument(), XFA_OBJECTTYPE_VariablesThis),
+ m_pThisNode(NULL),
+ m_pScriptNode(NULL) {
+ m_pThisNode = pThisNode;
+ m_pScriptNode = pScriptNode;
+}
+
+CXFA_ThisProxy::~CXFA_ThisProxy() {}
+
+CXFA_Node* CXFA_ThisProxy::GetThisNode() const {
+ return m_pThisNode;
+}
+
+CXFA_Node* CXFA_ThisProxy::GetScriptNode() const {
+ return m_pScriptNode;
+}
+
CXFA_NodeList::CXFA_NodeList(CXFA_Document* pDocument)
: CXFA_Object(pDocument, XFA_OBJECTTYPE_NodeList) {
m_pDocument->GetScriptContext()->AddToCacheList(
std::unique_ptr<CXFA_NodeList>(this));
}
+CXFA_NodeList::~CXFA_NodeList() {}
+XFA_ELEMENT CXFA_NodeList::GetClassID() const {
+ return XFA_ELEMENT_NodeList;
+}
CXFA_Node* CXFA_NodeList::NamedItem(const CFX_WideStringC& wsName) {
uint32_t dwHashCode = FX_HashCode_GetW(wsName, false);
int32_t iCount = GetLength();
@@ -5180,6 +5225,9 @@ void CXFA_NodeList::Script_ListClass_Length(CFXJSE_Value* pValue,
}
CXFA_ArrayNodeList::CXFA_ArrayNodeList(CXFA_Document* pDocument)
: CXFA_NodeList(pDocument) {}
+
+CXFA_ArrayNodeList::~CXFA_ArrayNodeList() {}
+
void CXFA_ArrayNodeList::SetArrayNodeList(const CXFA_NodeArray& srcArray) {
if (srcArray.GetSize() > 0) {
m_array.Copy(srcArray);