--- psiconv/trunk/lib/psiconv/generate_page.c 2004/02/04 12:19:09 196 +++ psiconv/trunk/lib/psiconv/generate_page.c 2004/02/26 16:27:43 233 @@ -44,16 +44,18 @@ psiconv_progress(config,lev,0,"Writing page header"); if (!value) { - psiconv_error(config,0,psiconv_buffer_length(buf),"Null page header"); + psiconv_error(config,lev,0,"Null page header"); res = -PSICONV_E_GENERATE; goto ERROR1; } if (!(basepara=psiconv_basic_paragraph_layout())) { + psiconv_error(config,lev+1,0,"Out of memory error"); res = -PSICONV_E_NOMEM; goto ERROR1; } if (!(basechar=psiconv_basic_character_layout())) { + psiconv_error(config,lev+1,0,"Out of memory error"); res = -PSICONV_E_NOMEM; goto ERROR2; } @@ -84,6 +86,10 @@ ERROR2: psiconv_free_paragraph_layout(basepara); ERROR1: + if (res) + psiconv_error(config,lev,0,"Writing of page header failed"); + else + psiconv_progress(config,lev,0,"End of page header"); return res; } @@ -97,7 +103,7 @@ psiconv_progress(config,lev,0,"Writing page layout section"); if (!value) { - psiconv_error(config,0,psiconv_buffer_length(buf),"Null page section"); + psiconv_error(config,lev,0,"Null page section"); res = -PSICONV_E_GENERATE; goto ERROR1; } @@ -128,9 +134,14 @@ goto ERROR3; if ((res = psiconv_write_bool(config,buf,lev+1,value->landscape))) goto ERROR3; - if ((res = psiconv_buffer_concat(buf,header_buf))) + if ((res = psiconv_buffer_concat(buf,header_buf))) { + psiconv_error(config,lev+1,0,"Out of memory error"); goto ERROR3; - res = psiconv_buffer_concat(buf,footer_buf); + } + if ((res = psiconv_buffer_concat(buf,footer_buf))) { + psiconv_error(config,lev+1,0,"Out of memory error"); + goto ERROR3; + } ERROR3: @@ -138,5 +149,9 @@ ERROR2: psiconv_buffer_free(header_buf); ERROR1: + if (res) + psiconv_error(config,lev,0,"Writing of page layout section failed"); + else + psiconv_progress(config,lev,0,"End of page layout section"); return res; }