summaryrefslogtreecommitdiff
path: root/fxjs/xfa/cjx_object.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 21:04:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 21:04:13 +0000
commit8eb2722e764fff0a39d0d1dc0c59473aa938b31f (patch)
tree0141be0ac4398c1c57b5ab2ed1ca0a77b1f11dc2 /fxjs/xfa/cjx_object.h
parentdf4f30eaaa469c3703118f89579d506209a49237 (diff)
downloadpdfium-8eb2722e764fff0a39d0d1dc0c59473aa938b31f.tar.xz
Add type information to CJX_Object::GetProperty
This CL adds a type template to the CJX_Object::GetProperty method so we can have the correct types returned. Change-Id: Ieda8ec4bd31d26a1e71af30f08b48eb826f5993d Reviewed-on: https://pdfium-review.googlesource.com/21250 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxjs/xfa/cjx_object.h')
-rw-r--r--fxjs/xfa/cjx_object.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index cf2ede7abf..f6ce3ccfb8 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -101,9 +101,10 @@ class CJX_Object {
bool bSyncData);
WideString GetContent(bool bScriptModify);
- CXFA_Node* GetProperty(int32_t index,
- XFA_Element eType,
- bool bCreateProperty);
+ template <typename T>
+ T* GetProperty(int32_t index, XFA_Element eType, bool bCreateProperty) {
+ return static_cast<T*>(GetPropertyInternal(index, eType, bCreateProperty));
+ }
void SetAttributeValue(const WideString& wsValue,
const WideString& wsXMLValue,
@@ -222,6 +223,20 @@ class CJX_Object {
void ThrowException(const wchar_t* str, ...) const;
private:
+ void Script_Boolean_DefaultValue(CFXJSE_Value* pValue,
+ bool bSetting,
+ XFA_Attribute eAttribute);
+ void Script_Draw_DefaultValue(CFXJSE_Value* pValue,
+ bool bSetting,
+ XFA_Attribute eAttribute);
+ void Script_Field_DefaultValue(CFXJSE_Value* pValue,
+ bool bSetting,
+ XFA_Attribute eAttribute);
+
+ CXFA_Node* GetPropertyInternal(int32_t index,
+ XFA_Element eType,
+ bool bCreateProperty);
+
void OnChanged(XFA_Attribute eAttr, bool bNotify, bool bScriptModify);
void OnChanging(XFA_Attribute eAttr, bool bNotify);
bool SetUserData(void* pKey,