void CScript_HostPseudoModel::ResetData(CFXJSE_Arguments* pArguments) { int32_t iLength = pArguments->GetLength(); if (iLength < 0 || iLength > 1) { ThrowException(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"resetData"); return; } CXFA_FFNotify* pNotify = m_pDocument->GetNotify(); if (!pNotify) { return; } CFX_WideString wsExpression; if (iLength >= 1) { CFX_ByteString bsExpression = pArguments->GetUTF8String(0); wsExpression = CFX_WideString::FromUTF8(bsExpression.AsStringC()); } if (wsExpression.IsEmpty()) { pNotify->ResetData(); return; } int32_t iStart = 0; CFX_WideString wsName; CXFA_Node* pNode = nullptr; int32_t iExpLength = wsExpression.GetLength(); while (iStart < iExpLength) { iStart = XFA_FilterName(wsExpression.AsStringC(), iStart, wsName); CXFA_ScriptContext* pScriptContext = m_pDocument->GetScriptContext(); if (!pScriptContext) { return; } CXFA_Object* pObject = pScriptContext->GetThisObject(); if (!pObject) { return; } uint32_t dwFlag = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings; XFA_RESOLVENODE_RS resoveNodeRS; int32_t iRet = pScriptContext->ResolveObjects(pObject, wsName.AsStringC(), resoveNodeRS, dwFlag); if (iRet < 1 || !resoveNodeRS.nodes[0]->IsNode()) { continue; } pNode = resoveNodeRS.nodes[0]->AsNode(); pNotify->ResetData(pNode->GetWidgetData()); } if (!pNode) { pNotify->ResetData(); } }