1 | /* |
1 | /* |
2 | generate_word.c - Part of psiconv, a PSION 5 file formats converter |
2 | generate_word.c - Part of psiconv, a PSION 5 file formats converter |
3 | Copyright (c) 2000 Frodo Looijaard <frodol@dds.nl> |
3 | Copyright (c) 2000-2004 Frodo Looijaard <frodol@dds.nl> |
4 | |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or |
7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
8 | (at your option) any later version. |
… | |
… | |
104 | res = psiconv_write_character_layout_list(config,buf,lev+1,value->normal->character, |
104 | res = psiconv_write_character_layout_list(config,buf,lev+1,value->normal->character, |
105 | basechar); |
105 | basechar); |
106 | basechar->font = font; |
106 | basechar->font = font; |
107 | if (res) |
107 | if (res) |
108 | goto ERROR3; |
108 | goto ERROR3; |
109 | if ((res = psiconv_write_u32(config,buf,lev+1,value->normal->hotkey))) |
109 | if ((res = psiconv_write_u32(config,buf,lev+1,psiconv_unicode_to_char(config,value->normal->hotkey)))) |
110 | goto ERROR3; |
110 | goto ERROR3; |
111 | if ((res = psiconv_write_u8(config,buf,lev+1,psiconv_list_length(value->styles)))) |
111 | if ((res = psiconv_write_u8(config,buf,lev+1,psiconv_list_length(value->styles)))) |
112 | goto ERROR3; |
112 | goto ERROR3; |
113 | |
113 | |
114 | |
114 | |
… | |
… | |
117 | if (!(style = psiconv_list_get(value->styles,i))) { |
117 | if (!(style = psiconv_list_get(value->styles,i))) { |
118 | psiconv_error(config,0,psiconv_buffer_length(buf),"Massive memory corruption"); |
118 | psiconv_error(config,0,psiconv_buffer_length(buf),"Massive memory corruption"); |
119 | res = -PSICONV_E_NOMEM; |
119 | res = -PSICONV_E_NOMEM; |
120 | goto ERROR3; |
120 | goto ERROR3; |
121 | } |
121 | } |
122 | if ((res = psiconv_write_u32(config,buf,lev+1,style->hotkey))) |
122 | if ((res = psiconv_write_u32(config,buf,lev+1,psiconv_unicode_to_char(config,style->hotkey)))) |
123 | goto ERROR3; |
123 | goto ERROR3; |
124 | } |
124 | } |
125 | if ((res = psiconv_write_u8(config,buf,lev+1,psiconv_list_length(value->styles)))) |
125 | if ((res = psiconv_write_u8(config,buf,lev+1,psiconv_list_length(value->styles)))) |
126 | goto ERROR3; |
126 | goto ERROR3; |
127 | for (i = 0; i < psiconv_list_length(value->styles); i++) { |
127 | for (i = 0; i < psiconv_list_length(value->styles); i++) { |