form_data->value = lo_FetchParamValue(context, tag, PARAM_VALUE);
if (form_data->type != FORM_TYPE_HIDDEN) form_data->value = lo_FetchParamValue(context, tag, PARAM_VALUE);
lo_form_input_minimal(MWContext *context, lo_DocState *state,	PA_Tag *tag, int32 type){	LO_FormElementStruct *form_element;	lo_FormElementMinimalData *form_data;	form_element = new_form_element(context, state, type);	if (form_element == NULL)	{		return(NULL);	}	form_element->element_data = lo_next_element_data(state, type);	if (form_element->element_data == NULL)	{		lo_FreeElement(context, (LO_Element *)form_element, FALSE);		return(NULL);	}	form_element->element_index =		state->top_state->savedData.FormList->data_index - 1;	form_data = (lo_FormElementMinimalData *)form_element->element_data;	/*	 * IF our starting type is NONE, this is a new element,	 * an we need to initialize the locations that will later	 * hold persistent data.	 */	if (form_data->type == FORM_TYPE_NONE)	{		form_data->FE_Data = NULL;	}	form_data->type = type;	form_data->name = lo_FetchParamValue(context, tag, PARAM_NAME);#ifdef NICE_BUT_NOT_NCSA_COMPAT	if (form_data->name == NULL)	{		if (form_data->type == FORM_TYPE_SUBMIT)		{			form_data->name = XP_ALLOC_BLOCK(XP_STRLEN(				DEF_SUBMIT_BUTTON_NAME) + 1);			if (form_data->name != NULL)			{				char *name;				XP_LOCK_BLOCK(name, char *, form_data->name);				XP_STRCPY(name, DEF_SUBMIT_BUTTON_NAME);				XP_UNLOCK_BLOCK(form_data->name);			}		}		else if (form_data->type == FORM_TYPE_RESET)		{			form_data->name = XP_ALLOC_BLOCK(XP_STRLEN(				DEF_RESET_BUTTON_NAME) + 1);			if (form_data->name != NULL)			{				char *name;				XP_LOCK_BLOCK(name, char *, form_data->name);				XP_STRCPY(name, DEF_RESET_BUTTON_NAME);				XP_UNLOCK_BLOCK(form_data->name);			}		}	}#endif /* NICE_BUT_NOT_NCSA_COMPAT */	form_data->value = lo_FetchParamValue(context, tag, PARAM_VALUE);	if (form_data->value == NULL)	{		if (form_data->type == FORM_TYPE_SUBMIT)		{			form_data->value = PA_ALLOC(				XP_STRLEN(DEF_SUBMIT_BUTTON_TEXT) + 1);			if (form_data->value != NULL)			{				char *value;				PA_LOCK(value, char *, form_data->value);				XP_STRCPY(value, DEF_SUBMIT_BUTTON_TEXT);				PA_UNLOCK(form_data->value);			}			else			{				state->top_state->out_of_memory = TRUE;			}		}		else if (form_data->type == FORM_TYPE_RESET)		{			form_data->value = PA_ALLOC(				XP_STRLEN(DEF_RESET_BUTTON_TEXT) + 1);			if (form_data->value != NULL)			{				char *value;				PA_LOCK(value, char *, form_data->value);				XP_STRCPY(value, DEF_RESET_BUTTON_TEXT);				PA_UNLOCK(form_data->value);			}			else			{				state->top_state->out_of_memory = TRUE;			}		}		else		{			form_data->value = PA_ALLOC(				XP_STRLEN(DEF_BUTTON_TEXT) + 1);			if (form_data->value != NULL)			{				char *value;				PA_LOCK(value, char *, form_data->value);				XP_STRCPY(value, DEF_BUTTON_TEXT);				PA_UNLOCK(form_data->value);			}			else			{				state->top_state->out_of_memory = TRUE;			}		}	}	else if ((type == FORM_TYPE_SUBMIT)||(type == FORM_TYPE_RESET))	{		int32 len;		char *value;		/*		 * strip newlines from single line button names		 */		PA_LOCK(value, char *, form_data->value);		len = XP_STRLEN(value);		len = lo_StripTextNewlines(value, len);		PA_UNLOCK(form_data->value);	}	/*	 * Buttons can set a preferred minimum width and height	 * in pixels that may be larger that what is needed	 * to display button text.	 */	if ((type == FORM_TYPE_SUBMIT)||(type == FORM_TYPE_RESET)||	    (type == FORM_TYPE_BUTTON))	{		PA_Block buff;		char *str;		int32 val;		buff = lo_FetchParamValue(context, tag, PARAM_WIDTH);		if (buff != NULL)		{			PA_LOCK(str, char *, buff);			val = XP_ATOI(str);			if (val < 0)			{				val = 0;			}			if (val > MAX_BUTTON_WIDTH)			{				val = MAX_BUTTON_WIDTH;			}			PA_UNLOCK(buff);			PA_FREE(buff);			form_element->width = val;		}		buff = lo_FetchParamValue(context, tag, PARAM_HEIGHT);		if (buff != NULL)		{			PA_LOCK(str, char *, buff);			val = XP_ATOI(str);			if (val < 0)			{				val = 0;			}			if (val > MAX_BUTTON_HEIGHT)			{				val = MAX_BUTTON_HEIGHT;			}			PA_UNLOCK(buff);			PA_FREE(buff);			form_element->height = val;		}	}#ifdef NEED_ISO_BACK_TRANSLATE	if ((type != FORM_TYPE_HIDDEN)&&(type != FORM_TYPE_KEYGEN))	{		char *tptr;		int16 charset;		PA_LOCK(tptr, char *, form_data->value);		charset = form_element->text_attr->charset;		tptr = FE_TranslateISOText(context, charset, tptr);		PA_UNLOCK(form_data->value);	}#endif	return(form_element);}