Commit ea7b1992 authored by Francois Cartegnie's avatar Francois Cartegnie

text_style: fix text_segment_Copy

parent 0b3d2393
...@@ -207,15 +207,21 @@ text_segment_t *text_segment_Copy( text_segment_t *p_src ) ...@@ -207,15 +207,21 @@ text_segment_t *text_segment_Copy( text_segment_t *p_src )
text_segment_t *p_dst = NULL, *p_dst0 = NULL; text_segment_t *p_dst = NULL, *p_dst0 = NULL;
while( p_src ) { while( p_src ) {
text_segment_t *p_next = text_segment_New( p_src->psz_text ); text_segment_t *p_new = text_segment_New( p_src->psz_text );
if( p_next ) if( p_new )
p_next->style = text_style_Duplicate( p_src->style ); p_new->style = text_style_Duplicate( p_src->style );
p_src = p_src->p_next;
if( p_dst == NULL ) if( p_dst == NULL )
p_dst = p_dst0 = p_next; {
p_dst = p_dst0 = p_new;
}
else else
p_dst->p_next = p_next; {
p_dst->p_next = p_new;
p_dst = p_dst->p_next;
}
p_src = p_src->p_next;
} }
return p_dst0; return p_dst0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment