if (state->current_anchor == NULL && state->cur_text_block != NULL && state->cur_text_block->anchor_href != NULL) { text_ele->anchor_href = state->cur_text_block->anchor_href; }
lo_new_text_element(MWContext *context,                    lo_DocState *state,                    ED_Element *edit_element,                    intn edit_offset ){	LO_TextStruct *text_ele = NULL;#ifdef DEBUG	assert (state);#endif	if (state == NULL)	{		return(NULL);	}	text_ele = (LO_TextStruct *)lo_NewElement(context, state, LO_TEXT, 			edit_element, edit_offset);	if (text_ele == NULL)	{#ifdef DEBUG		assert (state->top_state->out_of_memory);#endif		return(NULL);	}	text_ele->type = LO_TEXT;	text_ele->ele_id = NEXT_ELEMENT;	text_ele->x = state->x;	text_ele->x_offset = 0;	text_ele->y = state->y;	text_ele->y_offset = 0;	text_ele->width = 0;	text_ele->height = 0;	text_ele->next = NULL;	text_ele->prev = NULL;	if (state->line_buf_len > 0)	{		text_ele->text = PA_ALLOC((state->line_buf_len + 1) *			sizeof(char));		if (text_ele->text != NULL)		{			char *text_buf;			char *line;			PA_LOCK(line, char *, state->line_buf);			PA_LOCK(text_buf, char *, text_ele->text);			XP_BCOPY(line, text_buf, state->line_buf_len);			text_buf[state->line_buf_len] = '\0';			PA_UNLOCK(text_ele->text);			PA_UNLOCK(state->line_buf);			text_ele->text_len = (int16)state->line_buf_len;		}		else		{			state->top_state->out_of_memory = TRUE;			/*			 * free text element && return; it's no different			 * than if we had run out of memory allocating			 * the text element			 */			lo_FreeElement(context, (LO_Element *)text_ele, FALSE);			return(NULL);		}	}	else	{		text_ele->text = NULL;		text_ele->text_len = 0;	}	text_ele->anchor_href = state->current_anchor;	if (state->font_stack == NULL)	{		text_ele->text_attr = NULL;	}	else	{		text_ele->text_attr = state->cur_text_block->text_attr;	}	text_ele->ele_attrmask = 0;	if (state->breakable != FALSE)	{		text_ele->ele_attrmask |= LO_ELE_BREAKABLE;	}	text_ele->sel_start = -1;	text_ele->sel_end = -1;	return(text_ele);}