… | |
… | |
277 | |
277 | |
278 | psiconv_u32 text_len; |
278 | psiconv_u32 text_len; |
279 | psiconv_paragraph para; |
279 | psiconv_paragraph para; |
280 | psiconv_ucs2 temp; |
280 | psiconv_ucs2 temp; |
281 | psiconv_list line; |
281 | psiconv_list line; |
282 | psiconv_ucs2 *nextcharptr; |
|
|
283 | |
282 | |
284 | int nr; |
283 | int nr; |
285 | int i,j,leng; |
284 | int i,leng; |
286 | char *str_copy; |
285 | char *str_copy; |
287 | |
286 | |
288 | psiconv_progress(config,lev+1,off,"Going to parse the text section"); |
287 | psiconv_progress(config,lev+1,off,"Going to parse the text section"); |
289 | |
288 | |
290 | if(!(*result = psiconv_list_new(sizeof(*para)))) |
289 | if(!(*result = psiconv_list_new(sizeof(*para)))) |
… | |
… | |
312 | psiconv_error(config,lev+2,off+len+i,"Malformed text section"); |
311 | psiconv_error(config,lev+2,off+len+i,"Malformed text section"); |
313 | res = PSICONV_E_PARSE; |
312 | res = PSICONV_E_PARSE; |
314 | goto ERROR4; |
313 | goto ERROR4; |
315 | } |
314 | } |
316 | if ((temp == 0x06) || (i + leng == text_len)) { |
315 | if ((temp == 0x06) || (i + leng == text_len)) { |
317 | if (!(para->text = malloc(sizeof(*(para->text)) * |
316 | if (!(para->text = psiconv_unicode_from_list(line))) |
318 | (psiconv_list_length(line) + 1)))) |
|
|
319 | goto ERROR4; |
317 | goto ERROR4; |
320 | for (j = 0; j < psiconv_list_length(line); j++) { |
|
|
321 | if (!(nextcharptr = psiconv_list_get(line,j))) { |
|
|
322 | psiconv_error(config,lev+2,off+i+len,"Data structure corruption"); |
|
|
323 | goto ERROR5; |
|
|
324 | } |
|
|
325 | para->text[j] = *nextcharptr; |
|
|
326 | } |
|
|
327 | para->text[j] = 0; |
|
|
328 | |
318 | |
329 | if (!(str_copy = psiconv_make_printable(config,para->text))) |
319 | if (!(str_copy = psiconv_make_printable(config,para->text))) |
330 | goto ERROR5; |
320 | goto ERROR5; |
331 | psiconv_debug(config,lev+2,off+i+len,"Line %d: %d characters",nr, |
321 | psiconv_debug(config,lev+2,off+i+len,"Line %d: %d characters",nr, |
332 | strlen(str_copy) +1); |
322 | strlen(str_copy) +1); |
… | |
… | |
1234 | |
1224 | |
1235 | psiconv_progress(config,lev+2,off+len,"Going to read the icon name"); |
1225 | psiconv_progress(config,lev+2,off+len,"Going to read the icon name"); |
1236 | (*result)->icon_name = psiconv_read_string(config,buf,lev+2,off+len,&leng,&res); |
1226 | (*result)->icon_name = psiconv_read_string(config,buf,lev+2,off+len,&leng,&res); |
1237 | if (res) |
1227 | if (res) |
1238 | goto ERROR2; |
1228 | goto ERROR2; |
1239 | psiconv_debug(config,lev+2,off+len,"Icon name: %s",(*result)->icon_name); |
|
|
1240 | len += leng; |
1229 | len += leng; |
1241 | |
1230 | |
1242 | psiconv_progress(config,lev+2,off+len,"Going to read the icon width"); |
1231 | psiconv_progress(config,lev+2,off+len,"Going to read the icon width"); |
1243 | (*result)->icon_width = psiconv_read_length(config,buf,lev+2,off+len,&leng,&res); |
1232 | (*result)->icon_width = psiconv_read_length(config,buf,lev+2,off+len,&leng,&res); |
1244 | if (res) |
1233 | if (res) |