/[public]/psiconv/trunk/lib/psiconv/generate_texted.c
ViewVC logotype

Diff of /psiconv/trunk/lib/psiconv/generate_texted.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 196 Revision 233
42 psiconv_u32 layout_id; 42 psiconv_u32 layout_id;
43 43
44 psiconv_progress(config,lev,0,"Writing texted section"); 44 psiconv_progress(config,lev,0,"Writing texted section");
45 45
46 if (!value) { 46 if (!value) {
47 psiconv_error(config,0,psiconv_buffer_length(buf),"Null TextEd section"); 47 psiconv_error(config,lev,0,"Null TextEd section");
48 res = -PSICONV_E_GENERATE; 48 res = -PSICONV_E_GENERATE;
49 goto ERROR1; 49 goto ERROR1;
50 } 50 }
51 51
52 if (!(*extra_buf = psiconv_buffer_new())) { 52 if (!(*extra_buf = psiconv_buffer_new())) {
53 psiconv_error(config,lev+1,0,"Out of memory error");
53 res = -PSICONV_E_NOMEM; 54 res = -PSICONV_E_NOMEM;
54 goto ERROR1; 55 goto ERROR1;
55 } 56 }
56 57
57 layout_id = psiconv_buffer_unique_id(); 58 layout_id = psiconv_buffer_unique_id();
58 psiconv_buffer_add_target(*extra_buf,layout_id); 59 if ((res = psiconv_buffer_add_target(*extra_buf,layout_id))) {
60 psiconv_error(config,lev+1,0,"Out of memory error");
61 goto ERROR2;
62 }
59 63
60 if (psiconv_list_length(value->paragraphs)) { 64 if (psiconv_list_length(value->paragraphs)) {
61 with_layout_section = 1; 65 with_layout_section = 1;
62 if ((res = psiconv_write_styleless_layout_section(config,*extra_buf,lev+1, 66 if ((res = psiconv_write_styleless_layout_section(config,*extra_buf,lev+1,
63 value->paragraphs, 67 value->paragraphs,
88 } 92 }
89 93
90 if ((res = psiconv_write_u32(config,buf,lev+1,PSICONV_ID_TEXTED_TEXT))) 94 if ((res = psiconv_write_u32(config,buf,lev+1,PSICONV_ID_TEXTED_TEXT)))
91 goto ERROR2; 95 goto ERROR2;
92 96
93 return psiconv_write_text_section(config,buf,lev+1,value->paragraphs); 97 if ((res = psiconv_write_text_section(config,buf,lev+1,value->paragraphs)))
98 goto ERROR2;
99 psiconv_progress(config,lev,0,"End of texted section");
100 return 0;
94 101
95ERROR2: 102ERROR2:
96 psiconv_buffer_free(*extra_buf); 103 psiconv_buffer_free(*extra_buf);
97ERROR1: 104ERROR1:
105 psiconv_error(config,lev,0,"Writing of texted section failed");
98 return res; 106 return res;
99} 107}

Legend:
Removed from v.196  
changed lines
  Added in v.233

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26