summaryrefslogtreecommitdiff
path: root/fxjs/xfa/cjx_object.cpp
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.cpp
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.cpp')
-rw-r--r--fxjs/xfa/cjx_object.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index fcf77d434d..304b861dcf 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -619,7 +619,8 @@ bool CJX_Object::SetContent(const WideString& wsContent,
switch (ToNode(GetXFAObject())->GetObjectType()) {
case XFA_ObjectType::ContainerNode: {
if (XFA_FieldIsMultiListBox(ToNode(GetXFAObject()))) {
- CXFA_Node* pValue = GetProperty(0, XFA_Element::Value, true);
+ CXFA_Value* pValue =
+ GetProperty<CXFA_Value>(0, XFA_Element::Value, true);
if (!pValue)
break;
@@ -703,7 +704,8 @@ bool CJX_Object::SetContent(const WideString& wsContent,
if (ToNode(GetXFAObject())->GetElementType() == XFA_Element::ExclGroup) {
pNode = ToNode(GetXFAObject());
} else {
- CXFA_Node* pValue = GetProperty(0, XFA_Element::Value, true);
+ CXFA_Value* pValue =
+ GetProperty<CXFA_Value>(0, XFA_Element::Value, true);
if (!pValue)
break;
@@ -898,9 +900,9 @@ pdfium::Optional<WideString> CJX_Object::TryNamespace() {
return {static_cast<CFX_XMLElement*>(pXMLNode)->GetNamespaceURI()};
}
-CXFA_Node* CJX_Object::GetProperty(int32_t index,
- XFA_Element eProperty,
- bool bCreateProperty) {
+CXFA_Node* CJX_Object::GetPropertyInternal(int32_t index,
+ XFA_Element eProperty,
+ bool bCreateProperty) {
if (index < 0 ||
index >= ToNode(GetXFAObject())->PropertyOccuranceCount(eProperty)) {
return nullptr;