summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-23 15:52:14 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-23 15:52:14 +0000
commit1e5f87e7e1c1e5868ec675a0c45ddd97d2b4db2e (patch)
tree268e5b54868a00d8bba5ffc3125b7fbe2589cf2c /xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
parent08915150a3fb64aa1ebf9bdf20d1158a20b4266f (diff)
downloadpdfium-1e5f87e7e1c1e5868ec675a0c45ddd97d2b4db2e.tar.xz
Use accessor for WidgetAcc
This CL removes places where we store CXFA_WidgetAcc into a variable and uses the accessor from CXFA_Node instead. This will ease the removal of CXFA_WidgetAcc. Change-Id: I7a6cb0079bb119481a5ae60679a537799b3be2c9 Reviewed-on: https://pdfium-review.googlesource.com/23510 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_datamerger_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index 7c11149cb7..d843fa8896 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -134,7 +134,6 @@ void CreateDataBinding(CXFA_Node* pFormNode,
return;
ASSERT(pFormNode->IsWidgetReady());
- CXFA_WidgetAcc* pWidgetAcc = pFormNode->GetWidgetAcc();
auto* defValue = pFormNode->JSObject()->GetOrCreateProperty<CXFA_Value>(
0, XFA_Element::Value);
if (!bDataToForm) {
@@ -154,7 +153,8 @@ void CreateDataBinding(CXFA_Node* pFormNode,
ASSERT(pXMLDataElement);
pDataNode->JSObject()->SetAttributeValue(
- wsValue, pWidgetAcc->GetFormatDataValue(wsValue), false, false);
+ wsValue, pFormNode->GetWidgetAcc()->GetFormatDataValue(wsValue),
+ false, false);
pDataNode->JSObject()->SetCData(XFA_Attribute::ContentType,
wsContentType, false, false);
if (!wsHref.IsEmpty())
@@ -164,9 +164,9 @@ void CreateDataBinding(CXFA_Node* pFormNode,
}
case XFA_Element::ChoiceList:
wsValue = defValue ? defValue->GetChildValueContent() : L"";
- if (pWidgetAcc->IsChoiceListMultiSelect()) {
+ if (pFormNode->GetWidgetAcc()->IsChoiceListMultiSelect()) {
std::vector<WideString> wsSelTextArray =
- pWidgetAcc->GetSelectedItemsValue();
+ pFormNode->GetWidgetAcc()->GetSelectedItemsValue();
if (!wsSelTextArray.empty()) {
for (const auto& text : wsSelTextArray) {
CXFA_Node* pValue =
@@ -186,7 +186,8 @@ void CreateDataBinding(CXFA_Node* pFormNode,
}
} else if (!wsValue.IsEmpty()) {
pDataNode->JSObject()->SetAttributeValue(
- wsValue, pWidgetAcc->GetFormatDataValue(wsValue), false, false);
+ wsValue, pFormNode->GetWidgetAcc()->GetFormatDataValue(wsValue),
+ false, false);
}
break;
case XFA_Element::CheckButton:
@@ -195,7 +196,8 @@ void CreateDataBinding(CXFA_Node* pFormNode,
break;
pDataNode->JSObject()->SetAttributeValue(
- wsValue, pWidgetAcc->GetFormatDataValue(wsValue), false, false);
+ wsValue, pFormNode->GetWidgetAcc()->GetFormatDataValue(wsValue),
+ false, false);
break;
case XFA_Element::ExclGroup: {
CXFA_Node* pChecked = nullptr;
@@ -264,9 +266,10 @@ void CreateDataBinding(CXFA_Node* pFormNode,
if (wsValue.IsEmpty())
break;
- wsValue = pWidgetAcc->NormalizeNumStr(wsValue);
+ wsValue = pFormNode->GetWidgetAcc()->NormalizeNumStr(wsValue);
pDataNode->JSObject()->SetAttributeValue(
- wsValue, pWidgetAcc->GetFormatDataValue(wsValue), false, false);
+ wsValue, pFormNode->GetWidgetAcc()->GetFormatDataValue(wsValue),
+ false, false);
CXFA_Value* pValue =
pFormNode->JSObject()->GetOrCreateProperty<CXFA_Value>(
0, XFA_Element::Value);
@@ -279,14 +282,16 @@ void CreateDataBinding(CXFA_Node* pFormNode,
break;
pDataNode->JSObject()->SetAttributeValue(
- wsValue, pWidgetAcc->GetFormatDataValue(wsValue), false, false);
+ wsValue, pFormNode->GetWidgetAcc()->GetFormatDataValue(wsValue),
+ false, false);
break;
}
return;
}
WideString wsXMLValue = pDataNode->JSObject()->GetContent(false);
- WideString wsNormalizeValue = pWidgetAcc->GetNormalizeDataValue(wsXMLValue);
+ WideString wsNormalizeValue =
+ pFormNode->GetWidgetAcc()->GetNormalizeDataValue(wsXMLValue);
pDataNode->JSObject()->SetAttributeValue(wsNormalizeValue, wsXMLValue, false,
false);
@@ -315,7 +320,7 @@ void CreateDataBinding(CXFA_Node* pFormNode,
break;
}
case XFA_Element::ChoiceList:
- if (pWidgetAcc->IsChoiceListMultiSelect()) {
+ if (pFormNode->GetWidgetAcc()->IsChoiceListMultiSelect()) {
std::vector<CXFA_Node*> items = pDataNode->GetNodeList(
XFA_NODEFILTER_Children | XFA_NODEFILTER_Properties,
XFA_Element::Unknown);
@@ -348,8 +353,8 @@ void CreateDataBinding(CXFA_Node* pFormNode,
XFA_Element::Text);
break;
case XFA_Element::ExclGroup: {
- pWidgetAcc->SetSelectedMemberByValue(wsNormalizeValue.AsStringView(),
- false, false, false);
+ pFormNode->GetWidgetAcc()->SetSelectedMemberByValue(
+ wsNormalizeValue.AsStringView(), false, false, false);
break;
}
case XFA_Element::DateTimeEdit:
@@ -357,10 +362,11 @@ void CreateDataBinding(CXFA_Node* pFormNode,
XFA_Element::DateTime);
break;
case XFA_Element::NumericEdit: {
- WideString wsPicture =
- pWidgetAcc->GetPictureContent(XFA_VALUEPICTURE_DataBind);
+ WideString wsPicture = pFormNode->GetWidgetAcc()->GetPictureContent(
+ XFA_VALUEPICTURE_DataBind);
if (wsPicture.IsEmpty())
- wsNormalizeValue = pWidgetAcc->NormalizeNumStr(wsNormalizeValue);
+ wsNormalizeValue =
+ pFormNode->GetWidgetAcc()->NormalizeNumStr(wsNormalizeValue);
FormValueNode_SetChildContent(defValue, wsNormalizeValue,
XFA_Element::Float);