… | |
… | |
113 | psiconv_error(config,0,psiconv_buffer_length(buf),"Massive memory corruption"); |
113 | psiconv_error(config,0,psiconv_buffer_length(buf),"Massive memory corruption"); |
114 | res = -PSICONV_E_NOMEM; |
114 | res = -PSICONV_E_NOMEM; |
115 | goto ERROR; |
115 | goto ERROR; |
116 | } |
116 | } |
117 | for (j = 0; j < psiconv_unicode_strlen(paragraph->text); j++) |
117 | for (j = 0; j < psiconv_unicode_strlen(paragraph->text); j++) |
118 | if ((res = psiconv_write_u8(config,extra_buf,lev+1, |
118 | if ((res = psiconv_unicode_write_char(config,extra_buf,lev+1, |
119 | psiconv_unicode_to_char(config,paragraph->text[j])))) |
119 | paragraph->text[j]))) |
120 | goto ERROR; |
120 | goto ERROR; |
121 | psiconv_write_u8(config,extra_buf,lev+1,0x06); |
121 | psiconv_unicode_write_char(config,extra_buf,lev+1,0x06); |
122 | } |
122 | } |
123 | if ((res = psiconv_write_X(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) |
123 | if ((res = psiconv_write_X(config,buf,lev+1,psiconv_buffer_length(extra_buf)))) |
124 | goto ERROR; |
124 | goto ERROR; |
125 | res = psiconv_buffer_concat(buf,extra_buf); |
125 | res = psiconv_buffer_concat(buf,extra_buf); |
126 | } else |
126 | } else |
… | |
… | |
417 | goto ERROR3; |
417 | goto ERROR3; |
418 | if (!(styles_section->normal->paragraph = |
418 | if (!(styles_section->normal->paragraph = |
419 | psiconv_clone_paragraph_layout(base_para))) |
419 | psiconv_clone_paragraph_layout(base_para))) |
420 | goto ERROR4; |
420 | goto ERROR4; |
421 | styles_section->normal->hotkey = 0; |
421 | styles_section->normal->hotkey = 0; |
422 | if ((res = psiconv_unicode_from_chars(config,"", |
422 | if (!(styles_section->normal->name = psiconv_unicode_empty_string())) |
423 | &styles_section->normal->name))) |
|
|
424 | goto ERROR5; |
423 | goto ERROR5; |
425 | if (!(styles_section->styles = psiconv_list_new(sizeof( |
424 | if (!(styles_section->styles = psiconv_list_new(sizeof( |
426 | struct psiconv_word_style_s)))) |
425 | struct psiconv_word_style_s)))) |
427 | goto ERROR6; |
426 | goto ERROR6; |
428 | |
427 | |
… | |
… | |
523 | |
522 | |
524 | if ((res = psiconv_buffer_resolve(extra_buf))) |
523 | if ((res = psiconv_buffer_resolve(extra_buf))) |
525 | goto ERROR2; |
524 | goto ERROR2; |
526 | if ((res = psiconv_buffer_concat(buf,extra_buf))) |
525 | if ((res = psiconv_buffer_concat(buf,extra_buf))) |
527 | goto ERROR2; |
526 | goto ERROR2; |
|
|
527 | psiconv_buffer_free(extra_buf); |
528 | |
528 | |
529 | return 0; |
529 | return 0; |
530 | |
530 | |
531 | ERROR2: |
531 | ERROR2: |
532 | psiconv_buffer_free(extra_buf); |
532 | psiconv_buffer_free(extra_buf); |