*/
lo_PartialFormatImage(MWContext *context, lo_DocState *state, PA_Tag *tag){	LO_ImageStruct *image;    int32 layer_id;#ifdef MOCHA    LM_ImageEvent mocha_event;#endif /* MOCHA */	image = (LO_ImageStruct *)tag->lo_data;	if (image == NULL)	{		return;	}#ifdef MOCHA    layer_id = lo_CurrentLayerId(state);    image->layer_id = layer_id;    /* Reflect the image into Javascript */    lo_ReflectImage(context, state, tag, image, FALSE, layer_id);    /* Send any pending events to JavaScript */    if ((image->image_status == IL_IMAGE_COMPLETE) ||         (image->image_status == IL_FRAME_COMPLETE) ||        (image->image_status == IL_NOT_IN_CACHE)) {        mocha_event = LM_IMGLOAD;        ET_SendImageEvent(context, image, mocha_event);    }    else if (image->image_status == IL_ABORTED) {        mocha_event = LM_IMGABORT;        ET_SendImageEvent(context, image, mocha_event);    }    else if ((image->image_status == IL_ERROR_NO_DATA) ||             (image->image_status == IL_ERROR_IMAGE_DATA_CORRUPT) ||             (image->image_status == IL_ERROR_IMAGE_DATA_TRUNCATED) ||             (image->image_status == IL_ERROR_IMAGE_DATA_ILLEGAL) ||             (image->image_status == IL_ERROR_INTERNAL)) {        mocha_event = LM_IMGERROR;        ET_SendImageEvent(context, image, mocha_event);    }#endif	tag->lo_data = NULL;	/*	 * Assign it a properly sequencial element id.	 */	/*	image->ele_id = NEXT_ELEMENT;	image->x = state->x;	image->y = state->y;	*/	image->anchor_href = state->current_anchor;	if (image->border_width < 0)	{		if ((image->anchor_href != NULL)||		    (image->image_attr->usemap_name != NULL))		{			image->border_width = IMAGE_DEF_ANCHOR_BORDER;		}		else		{			image->border_width = IMAGE_DEF_BORDER;		}			image->border_width = FEUNITS_X(image->border_width, context);	}	if (state->font_stack == NULL)	{		LO_TextAttr tmp_attr;		LO_TextAttr *tptr;		/*		 * Fill in default font information.		 */		lo_SetDefaultFontAttr(state, &tmp_attr, context);		tptr = lo_FetchTextAttr(state, &tmp_attr);		image->text_attr = tptr;	}	else	{		image->text_attr = state->font_stack->text_attr;	}	if ((image->text_attr != NULL)&&		(image->text_attr->attrmask & LO_ATTR_ANCHOR))	{		image->image_attr->attrmask |= LO_ATTR_ANCHOR;	}	if (image->image_attr->usemap_name != NULL)	{		LO_TextAttr tmp_attr;		lo_CopyTextAttr(image->text_attr, &tmp_attr);		tmp_attr.fg.red =   STATE_UNVISITED_ANCHOR_RED(state);		tmp_attr.fg.green = STATE_UNVISITED_ANCHOR_GREEN(state);		tmp_attr.fg.blue =  STATE_UNVISITED_ANCHOR_BLUE(state);		image->text_attr = lo_FetchTextAttr(state, &tmp_attr);	}	lo_FillInImageGeometry( state, image );    /* During relayout the editor is not allowed to block. */    if ( (image->width == 0)||(image->height == 0))    {        if ( EDT_IN_RELAYOUT( context ) ){            lo_edt_AvoidImageBlock(image);        }    }    /*	 * We may have to block on this image until later	 * when the front end can give us the width and height.	 */	if ((image->width == 0)||(image->height == 0))	{		state->top_state->layout_blocking_element = (LO_Element *)image;	}	else	{		lo_FinishImage(context, state, image);	}}