--- psiconv/trunk/lib/psiconv/data.c 2003/11/22 22:17:04 163 +++ psiconv/trunk/lib/psiconv/data.c 2004/02/04 12:19:09 196 @@ -1,6 +1,6 @@ /* data.c - Part of psiconv, a PSION 5 file formats converter - Copyright (c) 1999, 2000 Frodo Looijaard + Copyright (c) 1999-2004 Frodo Looijaard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include #include "data.h" #include "list.h" +#include "unicode.h" #ifdef DMALLOC #include @@ -41,6 +42,9 @@ static void psiconv_free_formula_aux(void *data); static void psiconv_free_sheet_worksheet_aux (void *data); static void psiconv_free_sheet_variable_aux(void * variable); +static void psiconv_free_sheet_cell_aux(void *cell); +static void psiconv_free_sheet_line_aux(void *line); +static void psiconv_free_sheet_worksheet_aux (void *data); static psiconv_word_styles_section psiconv_empty_word_styles_section(void); static psiconv_text_and_layout psiconv_empty_text_and_layout(void); @@ -81,9 +85,12 @@ 0xff, /* green */ 0xff, /* blue */ }; + static psiconv_ucs2 font_times[16] = { 'T','i','m','e','s',' ', + 'N','e','w',' ', + 'R','o','m','a','n',0 }; static struct psiconv_font_s font = { - "Times New Roman", /* name */ + font_times, /* name */ 3 /* screenfont */ }; struct psiconv_character_layout_s cl = @@ -106,9 +113,13 @@ files themself. */ psiconv_paragraph_layout psiconv_basic_paragraph_layout(void) { + static psiconv_ucs2 font_times[16] = { 'T','i','m','e','s',' ', + 'N','e','w',' ', + 'R','o','m','a','n',0 }; + static struct psiconv_font_s font = { - "Times New Roman", /* name */ + font_times, /* name */ 2 /* screenfont */ }; static struct psiconv_color_s black = @@ -133,7 +144,7 @@ { psiconv_bool_false, /* on */ 10.0, /* font_size */ - 0x95, /* character */ + 0x201d, /* character */ psiconv_bool_true, /* indent */ &black, /* color */ &font, /* font */ @@ -192,7 +203,7 @@ if(!(result = malloc(sizeof(*result)))) goto ERROR1; *result = *font; - if (!(result->name = strdup(result->name))) + if (!(result->name = psiconv_unicode_strdup(result->name))) goto ERROR2; return result; ERROR2: @@ -490,7 +501,8 @@ free(section); } -void psiconv_free_object(psiconv_object object) +void psiconv_free_embedded_object_section + (psiconv_embedded_object_section object) { if (object) { psiconv_free_object_icon_section(object->icon); @@ -503,7 +515,8 @@ void psiconv_free_in_line_layout_aux(void * layout) { psiconv_free_character_layout(((psiconv_in_line_layout) layout)->layout); - psiconv_free_object(((psiconv_in_line_layout) layout)->object); + psiconv_free_embedded_object_section + (((psiconv_in_line_layout) layout)->object); } void psiconv_free_in_line_layout(psiconv_in_line_layout layout) @@ -945,7 +958,7 @@ if (!value1 || !value2 || !value1->name || !value2->name) return 1; if ((value1->screenfont == value2->screenfont) && - !strcmp(value1->name,value2->name)) + !psiconv_unicode_strcmp(value1->name,value2->name)) return 0; else return 1;