summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_widgetdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-12-14 20:09:43 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-12-14 20:09:43 +0000
commit0821c95ee9f132f77f3670a7dbbf114a82a6b9a0 (patch)
treefd736c2764ee7b1e187995548a608ed431601ac7 /xfa/fxfa/parser/cxfa_widgetdata.cpp
parentdcbb8e53e604178dc97d12846ddbdef88be41297 (diff)
downloadpdfium-0821c95ee9f132f77f3670a7dbbf114a82a6b9a0.tar.xz
Fold CXFA_ValueData into CXFA_Value
The CXFA_ValueData class is a thin wrapper around the CXFA_Value, this CL moves the methods from CXFA_ValueData into CXFA_Value. Change-Id: I2c57e93e5c4675b82af71cf75f2dfc0fb12e4b20 Reviewed-on: https://pdfium-review.googlesource.com/21170 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_widgetdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 58c934132c..bb1f259d00 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -16,6 +16,7 @@
#include "xfa/fxfa/parser/cxfa_measurement.h"
#include "xfa/fxfa/parser/cxfa_node.h"
#include "xfa/fxfa/parser/cxfa_validate.h"
+#include "xfa/fxfa/parser/cxfa_value.h"
#include "xfa/fxfa/parser/xfa_utils.h"
namespace {
@@ -69,9 +70,10 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
eWidgetType = XFA_Element::Unknown;
XFA_Element eUIType = XFA_Element::Unknown;
- CXFA_ValueData defValueData(
+ auto* defValue = static_cast<CXFA_Value*>(
pNode->JSObject()->GetProperty(0, XFA_Element::Value, true));
- XFA_Element eValueType = defValueData.GetChildValueClassID();
+ XFA_Element eValueType =
+ defValue ? defValue->GetChildValueClassID() : XFA_Element::Unknown;
switch (eValueType) {
case XFA_Element::Boolean:
eUIType = XFA_Element::CheckButton;
@@ -152,8 +154,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
if (!pUIChild) {
if (eUIType == XFA_Element::Unknown) {
eUIType = XFA_Element::TextEdit;
- defValueData.GetNode()->JSObject()->GetProperty(0, XFA_Element::Text,
- true);
+ defValue->JSObject()->GetProperty(0, XFA_Element::Text, true);
}
return pUI->JSObject()->GetProperty(0, eUIType, true);
}
@@ -195,7 +196,7 @@ CXFA_Node* CreateUIChild(CXFA_Node* pNode, XFA_Element& eWidgetType) {
eValueType = XFA_Element::Text;
break;
}
- defValueData.GetNode()->JSObject()->GetProperty(0, eValueType, true);
+ defValue->JSObject()->GetProperty(0, eValueType, true);
return pUIChild;
}
@@ -295,15 +296,14 @@ std::vector<CXFA_Node*> CXFA_WidgetData::GetEventByActivity(
return events;
}
-CXFA_ValueData CXFA_WidgetData::GetDefaultValueData() {
+CXFA_Value* CXFA_WidgetData::GetDefaultValue() {
CXFA_Node* pTemNode = m_pNode->GetTemplateNode();
- return CXFA_ValueData(
- pTemNode ? pTemNode->JSObject()->GetProperty(0, XFA_Element::Value, false)
- : nullptr);
+ return static_cast<CXFA_Value*>(
+ pTemNode->JSObject()->GetProperty(0, XFA_Element::Value, false));
}
-CXFA_ValueData CXFA_WidgetData::GetFormValueData() {
- return CXFA_ValueData(
+CXFA_Value* CXFA_WidgetData::GetFormValue() {
+ return static_cast<CXFA_Value*>(
m_pNode->JSObject()->GetProperty(0, XFA_Element::Value, false));
}