From 1e5f87e7e1c1e5868ec675a0c45ddd97d2b4db2e Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 23 Jan 2018 15:52:14 +0000 Subject: 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 Commit-Queue: dsinclair --- fpdfsdk/cpdfsdk_widget.cpp | 70 +++++++++++++------------ fxjs/xfa/cjx_exclgroup.cpp | 5 +- fxjs/xfa/cjx_field.cpp | 37 ++++++------- xfa/fxfa/cxfa_ffnotify.cpp | 59 ++++++++++----------- xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 38 ++++++++------ 5 files changed, 108 insertions(+), 101 deletions(-) diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp index eb02f7c743..ec63bac68f 100644 --- a/fpdfsdk/cpdfsdk_widget.cpp +++ b/fpdfsdk/cpdfsdk_widget.cpp @@ -292,7 +292,6 @@ void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) { if (!node->IsWidgetReady()) return; - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); CPDF_FormField* pFormField = GetFormField(); switch (GetFieldType()) { case FormFieldType::kCheckBox: @@ -300,31 +299,37 @@ void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) { CPDF_FormControl* pFormCtrl = GetFormControl(); XFA_CHECKSTATE eCheckState = pFormCtrl->IsChecked() ? XFA_CHECKSTATE_On : XFA_CHECKSTATE_Off; - pWidgetAcc->SetCheckState(eCheckState, true); + node->GetWidgetAcc()->SetCheckState(eCheckState, true); break; } case FormFieldType::kTextField: - pWidgetAcc->SetValue(XFA_VALUEPICTURE_Edit, pFormField->GetValue()); + node->GetWidgetAcc()->SetValue(XFA_VALUEPICTURE_Edit, + pFormField->GetValue()); break; case FormFieldType::kListBox: { - pWidgetAcc->ClearAllSelections(); + node->GetWidgetAcc()->ClearAllSelections(); for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++) { int nIndex = pFormField->GetSelectedIndex(i); - if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems(false)) - pWidgetAcc->SetItemState(nIndex, true, false, false, true); + if (nIndex > -1 && + nIndex < node->GetWidgetAcc()->CountChoiceListItems(false)) { + node->GetWidgetAcc()->SetItemState(nIndex, true, false, false, true); + } } break; } case FormFieldType::kComboBox: { - pWidgetAcc->ClearAllSelections(); + node->GetWidgetAcc()->ClearAllSelections(); for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++) { int nIndex = pFormField->GetSelectedIndex(i); - if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems(false)) - pWidgetAcc->SetItemState(nIndex, true, false, false, true); + if (nIndex > -1 && + nIndex < node->GetWidgetAcc()->CountChoiceListItems(false)) { + node->GetWidgetAcc()->SetItemState(nIndex, true, false, false, true); + } } - pWidgetAcc->SetValue(XFA_VALUEPICTURE_Edit, pFormField->GetValue()); + node->GetWidgetAcc()->SetValue(XFA_VALUEPICTURE_Edit, + pFormField->GetValue()); break; } default: @@ -333,7 +338,7 @@ void CPDFSDK_Widget::Synchronize(bool bSynchronizeElse) { if (bSynchronizeElse) { CPDFXFA_Context* context = m_pPageView->GetFormFillEnv()->GetXFAContext(); - context->GetXFADocView()->ProcessValueChanged(pWidgetAcc); + context->GetXFADocView()->ProcessValueChanged(node->GetWidgetAcc()); } } @@ -401,9 +406,9 @@ void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, pFormField->ClearSelection(false); if (node->IsWidgetReady()) { - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); - for (int i = 0, sz = pWidgetAcc->CountSelectedItems(); i < sz; i++) { - int nIndex = pWidgetAcc->GetSelectedItem(i); + for (int i = 0, sz = node->GetWidgetAcc()->CountSelectedItems(); i < sz; + i++) { + int nIndex = node->GetWidgetAcc()->GetSelectedItem(i); if (nIndex > -1 && nIndex < pFormField->CountOptions()) { pFormField->SetItemSelection(nIndex, true, true); @@ -416,16 +421,16 @@ void CPDFSDK_Widget::SynchronizeXFAValue(CXFA_FFDocView* pXFADocView, pFormField->ClearSelection(false); if (node->IsWidgetReady()) { - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); - for (int i = 0, sz = pWidgetAcc->CountSelectedItems(); i < sz; i++) { - int nIndex = pWidgetAcc->GetSelectedItem(i); + for (int i = 0, sz = node->GetWidgetAcc()->CountSelectedItems(); i < sz; + i++) { + int nIndex = node->GetWidgetAcc()->GetSelectedItem(i); if (nIndex > -1 && nIndex < pFormField->CountOptions()) { pFormField->SetItemSelection(nIndex, true, true); } } - pFormField->SetValue(pWidgetAcc->GetValue(XFA_VALUEPICTURE_Display), - true); + pFormField->SetValue( + node->GetWidgetAcc()->GetValue(XFA_VALUEPICTURE_Display), true); } break; } @@ -447,11 +452,11 @@ void CPDFSDK_Widget::SynchronizeXFAItems(CXFA_FFDocView* pXFADocView, pFormField->ClearOptions(true); if (node->IsWidgetReady()) { - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); - for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(false); i < sz; - i++) { + for (int i = 0, sz = node->GetWidgetAcc()->CountChoiceListItems(false); + i < sz; i++) { pFormField->InsertOption( - pWidgetAcc->GetChoiceListItem(i, false).value_or(L""), i, true); + node->GetWidgetAcc()->GetChoiceListItem(i, false).value_or(L""), + i, true); } } break; @@ -461,11 +466,11 @@ void CPDFSDK_Widget::SynchronizeXFAItems(CXFA_FFDocView* pXFADocView, pFormField->ClearOptions(false); if (node->IsWidgetReady()) { - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); - for (int i = 0, sz = pWidgetAcc->CountChoiceListItems(false); i < sz; - i++) { + for (int i = 0, sz = node->GetWidgetAcc()->CountChoiceListItems(false); + i < sz; i++) { pFormField->InsertOption( - pWidgetAcc->GetChoiceListItem(i, false).value_or(L""), i, false); + node->GetWidgetAcc()->GetChoiceListItem(i, false).value_or(L""), + i, false); } } @@ -616,9 +621,8 @@ int CPDFSDK_Widget::GetSelectedIndex(int nIndex) const { if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) { CXFA_Node* node = hWidget->GetNode(); if (node->IsWidgetReady()) { - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); - if (nIndex < pWidgetAcc->CountSelectedItems()) - return pWidgetAcc->GetSelectedItem(nIndex); + if (nIndex < node->GetWidgetAcc()->CountSelectedItems()) + return node->GetWidgetAcc()->GetSelectedItem(nIndex); } } #endif // PDF_ENABLE_XFA @@ -662,9 +666,9 @@ bool CPDFSDK_Widget::IsOptionSelected(int nIndex) const { if (CXFA_FFWidget* hWidget = GetMixXFAWidget()) { CXFA_Node* node = hWidget->GetNode(); if (node->IsWidgetReady()) { - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); - if (nIndex > -1 && nIndex < pWidgetAcc->CountChoiceListItems(false)) - return pWidgetAcc->GetItemState(nIndex); + if (nIndex > -1 && + nIndex < node->GetWidgetAcc()->CountChoiceListItems(false)) + return node->GetWidgetAcc()->GetItemState(nIndex); return false; } diff --git a/fxjs/xfa/cjx_exclgroup.cpp b/fxjs/xfa/cjx_exclgroup.cpp index 6d9f5407de..afee17ab86 100644 --- a/fxjs/xfa/cjx_exclgroup.cpp +++ b/fxjs/xfa/cjx_exclgroup.cpp @@ -93,12 +93,11 @@ CJS_Return CJX_ExclGroup::selectedMember( if (!node->IsWidgetReady()) return CJS_Return(runtime->NewNull()); - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); CXFA_Node* pReturnNode = nullptr; if (params.empty()) { - pReturnNode = pWidgetAcc->GetSelectedMember(); + pReturnNode = node->GetWidgetAcc()->GetSelectedMember(); } else { - pReturnNode = pWidgetAcc->SetSelectedMember( + pReturnNode = node->GetWidgetAcc()->SetSelectedMember( runtime->ToWideString(params[0]).AsStringView(), true); } if (!pReturnNode) diff --git a/fxjs/xfa/cjx_field.cpp b/fxjs/xfa/cjx_field.cpp index 34b944f66d..e27f153646 100644 --- a/fxjs/xfa/cjx_field.cpp +++ b/fxjs/xfa/cjx_field.cpp @@ -191,14 +191,13 @@ CJS_Return CJX_Field::setItemState( if (!node->IsWidgetReady()) return CJS_Return(true); - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); int32_t iIndex = runtime->ToInt32(params[0]); if (runtime->ToInt32(params[1]) != 0) { - pWidgetAcc->SetItemState(iIndex, true, true, true, true); + node->GetWidgetAcc()->SetItemState(iIndex, true, true, true, true); return CJS_Return(true); } - if (pWidgetAcc->GetItemState(iIndex)) - pWidgetAcc->SetItemState(iIndex, false, true, true, true); + if (node->GetWidgetAcc()->GetItemState(iIndex)) + node->GetWidgetAcc()->SetItemState(iIndex, false, true, true, true); return CJS_Return(true); } @@ -246,7 +245,6 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue, if (!xfaNode->IsWidgetReady()) return; - CXFA_WidgetAcc* pWidgetAcc = xfaNode->GetWidgetAcc(); if (bSetting) { if (pValue) { xfaNode->SetPreNull(xfaNode->IsNull()); @@ -258,8 +256,9 @@ void CJX_Field::defaultValue(CFXJSE_Value* pValue, wsNewText = pValue->ToWideString(); if (xfaNode->GetUIChild()->GetElementType() == XFA_Element::NumericEdit) { - wsNewText = pWidgetAcc->NumericLimit( - wsNewText, pWidgetAcc->GetLeadDigits(), pWidgetAcc->GetFracDigits()); + wsNewText = xfaNode->GetWidgetAcc()->NumericLimit( + wsNewText, xfaNode->GetWidgetAcc()->GetLeadDigits(), + xfaNode->GetWidgetAcc()->GetFracDigits()); } CXFA_Node* pContainerNode = xfaNode->GetContainerNode(); @@ -308,13 +307,15 @@ void CJX_Field::editValue(CFXJSE_Value* pValue, if (!node->IsWidgetReady()) return; - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); if (bSetting) { - pWidgetAcc->SetValue(XFA_VALUEPICTURE_Edit, pValue->ToWideString()); + node->GetWidgetAcc()->SetValue(XFA_VALUEPICTURE_Edit, + pValue->ToWideString()); return; } - pValue->SetString( - pWidgetAcc->GetValue(XFA_VALUEPICTURE_Edit).UTF8Encode().AsStringView()); + pValue->SetString(node->GetWidgetAcc() + ->GetValue(XFA_VALUEPICTURE_Edit) + .UTF8Encode() + .AsStringView()); } void CJX_Field::formatMessage(CFXJSE_Value* pValue, @@ -330,12 +331,13 @@ void CJX_Field::formattedValue(CFXJSE_Value* pValue, if (!node->IsWidgetReady()) return; - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); if (bSetting) { - pWidgetAcc->SetValue(XFA_VALUEPICTURE_Display, pValue->ToWideString()); + node->GetWidgetAcc()->SetValue(XFA_VALUEPICTURE_Display, + pValue->ToWideString()); return; } - pValue->SetString(pWidgetAcc->GetValue(XFA_VALUEPICTURE_Display) + pValue->SetString(node->GetWidgetAcc() + ->GetValue(XFA_VALUEPICTURE_Display) .UTF8Encode() .AsStringView()); } @@ -357,19 +359,18 @@ void CJX_Field::selectedIndex(CFXJSE_Value* pValue, if (!node->IsWidgetReady()) return; - CXFA_WidgetAcc* pWidgetAcc = node->GetWidgetAcc(); if (!bSetting) { - pValue->SetInteger(pWidgetAcc->GetSelectedItem(0)); + pValue->SetInteger(node->GetWidgetAcc()->GetSelectedItem(0)); return; } int32_t iIndex = pValue->ToInteger(); if (iIndex == -1) { - pWidgetAcc->ClearAllSelections(); + node->GetWidgetAcc()->ClearAllSelections(); return; } - pWidgetAcc->SetItemState(iIndex, true, true, true, true); + node->GetWidgetAcc()->SetItemState(iIndex, true, true, true, true); } void CJX_Field::access(CFXJSE_Value* pValue, diff --git a/xfa/fxfa/cxfa_ffnotify.cpp b/xfa/fxfa/cxfa_ffnotify.cpp index 0d9c8518eb..072359b621 100644 --- a/xfa/fxfa/cxfa_ffnotify.cpp +++ b/xfa/fxfa/cxfa_ffnotify.cpp @@ -193,19 +193,19 @@ CXFA_ContentLayoutItem* CXFA_FFNotify::OnCreateContentLayoutItem( void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem, float& fCalcWidth, float& fCalcHeight) { - CXFA_WidgetAcc* pAcc = pItem->GetWidgetAcc(); - if (!pAcc) + if (!pItem->GetWidgetAcc()) return; - pAcc->StartWidgetLayout(m_pDoc.Get(), fCalcWidth, fCalcHeight); + pItem->GetWidgetAcc()->StartWidgetLayout(m_pDoc.Get(), fCalcWidth, + fCalcHeight); } bool CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem, int32_t iBlockIndex, float& fCalcHeightPos) { - CXFA_WidgetAcc* pAcc = pItem->GetWidgetAcc(); - return pAcc && - pAcc->FindSplitPos(m_pDoc->GetDocView(), iBlockIndex, fCalcHeightPos); + return pItem->GetWidgetAcc() && + pItem->GetWidgetAcc()->FindSplitPos(m_pDoc->GetDocView(), iBlockIndex, + fCalcHeightPos); } bool CXFA_FFNotify::RunScript(CXFA_Script* script, CXFA_Node* item) { @@ -237,13 +237,11 @@ void CXFA_FFNotify::AddCalcValidate(CXFA_Node* pNode) { CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); if (!pDocView) return; - - CXFA_WidgetAcc* pWidgetAcc = pNode->GetWidgetAcc(); - if (!pWidgetAcc) + if (!pNode->GetWidgetAcc()) return; - pDocView->AddCalculateWidgetAcc(pWidgetAcc); - pDocView->AddValidateWidget(pWidgetAcc); + pDocView->AddCalculateWidgetAcc(pNode->GetWidgetAcc()); + pDocView->AddValidateWidget(pNode->GetWidgetAcc()); } CXFA_FFDoc* CXFA_FFNotify::GetHDOC() { @@ -320,8 +318,9 @@ CXFA_Node* CXFA_FFNotify::GetFocusWidgetNode() { if (!pDocView) return nullptr; - CXFA_WidgetAcc* pAcc = pDocView->GetFocusWidgetAcc(); - return pAcc ? pAcc->GetNode() : nullptr; + return pDocView->GetFocusWidgetAcc() + ? pDocView->GetFocusWidgetAcc()->GetNode() + : nullptr; } void CXFA_FFNotify::SetFocusWidgetNode(CXFA_Node* pNode) { @@ -329,8 +328,7 @@ void CXFA_FFNotify::SetFocusWidgetNode(CXFA_Node* pNode) { if (!pDocView) return; - CXFA_WidgetAcc* pAcc = pNode ? pNode->GetWidgetAcc() : nullptr; - pDocView->SetFocusWidgetAcc(pAcc); + pDocView->SetFocusWidgetAcc(pNode ? pNode->GetWidgetAcc() : nullptr); } void CXFA_FFNotify::OnNodeReady(CXFA_Node* pNode) { @@ -368,14 +366,11 @@ void CXFA_FFNotify::OnValueChanging(CXFA_Node* pSender, XFA_Attribute eAttr) { return; if (pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End) return; - - CXFA_WidgetAcc* pWidgetAcc = pSender->GetWidgetAcc(); - if (!pWidgetAcc) + if (!pSender->GetWidgetAcc()) return; - CXFA_FFWidget* pWidget = - m_pDoc->GetDocView()->GetWidgetForNode(pWidgetAcc->GetNode()); - for (; pWidget; pWidget = pWidgetAcc->GetNextWidget(pWidget)) { + CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pSender); + for (; pWidget; pWidget = pSender->GetWidgetAcc()->GetNextWidget(pWidget)) { if (pWidget->IsLoaded()) pWidget->AddInvalidateRect(); } @@ -397,15 +392,15 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, XFA_Element eType = pParentNode->GetElementType(); bool bIsContainerNode = pParentNode->IsContainerNode(); - CXFA_WidgetAcc* pWidgetAcc = pWidgetNode->GetWidgetAcc(); - if (!pWidgetAcc) + if (!pWidgetNode->GetWidgetAcc()) return; bool bUpdateProperty = false; pDocView->SetChangeMark(); switch (eType) { case XFA_Element::Caption: { - CXFA_TextLayout* pCapOut = pWidgetAcc->GetCaptionTextLayout(); + CXFA_TextLayout* pCapOut = + pWidgetNode->GetWidgetAcc()->GetCaptionTextLayout(); if (!pCapOut) return; @@ -426,20 +421,22 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, pDocView->AddCalculateNodeNotify(pSender); if (eType == XFA_Element::Value || bIsContainerNode) { if (bIsContainerNode) { - pWidgetAcc->UpdateUIDisplay(m_pDoc->GetDocView(), nullptr); - pDocView->AddCalculateWidgetAcc(pWidgetAcc); - pDocView->AddValidateWidget(pWidgetAcc); + pWidgetNode->GetWidgetAcc()->UpdateUIDisplay(m_pDoc->GetDocView(), + nullptr); + pDocView->AddCalculateWidgetAcc(pWidgetNode->GetWidgetAcc()); + pDocView->AddValidateWidget(pWidgetNode->GetWidgetAcc()); } else if (pWidgetNode->GetParent()->GetElementType() == XFA_Element::ExclGroup) { - pWidgetAcc->UpdateUIDisplay(m_pDoc->GetDocView(), nullptr); + pWidgetNode->GetWidgetAcc()->UpdateUIDisplay(m_pDoc->GetDocView(), + nullptr); } return; } } - CXFA_FFWidget* pWidget = - m_pDoc->GetDocView()->GetWidgetForNode(pWidgetAcc->GetNode()); - for (; pWidget; pWidget = pWidgetAcc->GetNextWidget(pWidget)) { + CXFA_FFWidget* pWidget = m_pDoc->GetDocView()->GetWidgetForNode(pWidgetNode); + for (; pWidget; + pWidget = pWidgetNode->GetWidgetAcc()->GetNextWidget(pWidget)) { if (!pWidget->IsLoaded()) continue; 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( 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 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( 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 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); -- cgit v1.2.3