FX_BOOL CXFA_FFNotify::RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem) { FX_BOOL bRet = FALSE; CXFA_FFDocView* pDocView = m_pDoc->GetDocView(); if (!pDocView) { return bRet; } CXFA_WidgetAcc* pWidgetAcc = static_cast<CXFA_WidgetAcc*>(pFormItem->GetWidgetData()); if (!pWidgetAcc) { return bRet; } CXFA_EventParam EventParam; EventParam.m_eType = XFA_EVENT_Unknown; CFXJSE_Value* pRetValue = nullptr; int32_t iRet = pWidgetAcc->ExecuteScript(CXFA_Script(pScript), &EventParam, &pRetValue); if (iRet == XFA_EVENTERROR_Success && pRetValue) { bRet = pRetValue->ToBoolean(); delete pRetValue; } return bRet; }
FX_BOOL FXJSE_Value_ToBoolean(FXJSE_HVALUE hValue) { CFXJSE_Value* lpValue = reinterpret_cast<CFXJSE_Value*>(hValue); ASSERT(lpValue); return lpValue->ToBoolean(); }