--- psiconv/trunk/program/psiconv/gen_html4.c 2000/10/21 00:49:13 53 +++ psiconv/trunk/program/psiconv/gen_html4.c 2002/01/29 18:38:38 142 @@ -23,8 +23,8 @@ #include #include #include -#include "data.h" -#include "list.h" +#include "psiconv/data.h" +#include "psiconv/list.h" #include "gen.h" #include "psiconv.h" @@ -32,6 +32,10 @@ #define TRUE (0==0) #endif +#ifdef DMALLOC +#include "dmalloc.h" +#endif + /* * Various string tables for HTML4 settings */ @@ -132,11 +136,11 @@ static const char *screenfont_name(psiconv_u8 screenfont) { - if (screenfont == 1) + if (screenfont == psiconv_font_sansserif) return "sans-serif"; - else if (screenfont == 2) + else if (screenfont == psiconv_font_nonprop) return "monospace"; - else if (screenfont == 3) + else if (screenfont == psiconv_font_serif) return "serif"; else return "serif"; @@ -212,13 +216,13 @@ const psiconv_paragraph_layout old, const psiconv_paragraph_layout new) { - return ((old->top_space != new->top_space) || + return ((old->space_above != new->space_above) || (old->indent_right != new->indent_right) || - (old->bottom_space != new->bottom_space) || + (old->space_below != new->space_below) || (old->indent_left != new->indent_left) || (old->indent_first != new->indent_first) || (old->justify_hor != new->justify_hor) || - (old->interline_exact != new->interline_exact) || + (old->linespacing_exact != new->linespacing_exact) || borders_different(old->left_border, new->left_border) || borders_different(old->right_border, new->right_border) || borders_different(old->top_border, new->top_border) || @@ -229,12 +233,12 @@ const psiconv_paragraph_layout old, const psiconv_paragraph_layout new) { - if (!old || (old->top_space != new->top_space)) - fprintf(of, "margin-top:%.1fpt;", new->top_space); + if (!old || (old->space_above != new->space_above)) + fprintf(of, "margin-top:%.1fpt;", new->space_above); if (!old || (old->indent_right != new->indent_right)) fprintf(of, "margin-right:%.2fcm;", new->indent_right); - if (!old || (old->bottom_space != new->bottom_space)) - fprintf(of, "margin-bottom:%.1fpt;", new->bottom_space); + if (!old || (old->space_below != new->space_below)) + fprintf(of, "margin-bottom:%.1fpt;", new->space_below); if (!old || (old->bullet->on != new->bullet->on) || (old->bullet->indent != new->bullet->indent) || @@ -254,11 +258,11 @@ } if (!old || (old->justify_hor != new->justify_hor)) fprintf(of, "text-align:%s;", justify_strings[new->justify_hor]); - if (!old || (old->interline_exact != new->interline_exact)) { - if (!old || old->interline_exact) + if (!old || (old->linespacing_exact != new->linespacing_exact)) { + if (!old || old->linespacing_exact) fputs("line-height:normal;", of); else - fprintf(of, "line-height:%.1fpt;", new->interline); + fprintf(of, "line-height:%.1fpt;", new->linespacing); } fput_border(of, "left", old ? old->left_border : NULL, new->left_border); @@ -288,7 +292,7 @@ (old->bold != new->bold) || (old->super_sub != new->super_sub) || (old->underline != new->underline) || - (old->strike_out != new->strike_out)); + (old->strikethrough != new->strikethrough)); } static void fput_character_layout(FILE * of, @@ -317,13 +321,13 @@ if (!old || (old->super_sub != new->super_sub)) fprintf(of, "vertical-align:%s;", vertical_strings[new->super_sub]); if (!old || (old->underline != new->underline) || - (old->strike_out != new->strike_out)) { + (old->strikethrough != new->strikethrough)) { fputs("text-decoration:", of); - if (new->strike_out) + if (new->strikethrough) fputs("line-through ", of); if (new->underline) fputs("underline", of); - else if (!new->strike_out) + else if (!new->strikethrough) fputs("none", of); fputs(";", of); } @@ -470,12 +474,14 @@ fputs("\n\n\n \n", of); - if (psiconv_list_length(wf->page_sec->header->text->paragraphs) > 0) { - fputs(" ", of); - para = psiconv_list_get(wf->page_sec->header->text->paragraphs, 0); - i = 0; - fput_text(of, para->text, strlen(para->text), &i); - fputs("\n", of); + if (wf->page_sec->header->text) { + if (psiconv_list_length(wf->page_sec->header->text->paragraphs) > 0) { + fputs(" ", of); + para = psiconv_list_get(wf->page_sec->header->text->paragraphs, 0); + i = 0; + fput_text(of, para->text, strlen(para->text), &i); + fputs("\n", of); + } } normal = wf->styles_sec->normal; @@ -490,16 +496,18 @@ fput_style(of, normal, sty, wf); } fputs(" -->\n\n\n", of); - for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { - para = psiconv_list_get(wf->paragraphs, i); - fput_para(of, para, wf); + if (wf->page_sec->header->text) { + for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { + para = psiconv_list_get(wf->paragraphs, i); + fput_para(of, para, wf); + } } fputs("\n\n", of); return fclose(of); } -static struct psiconv_fileformat ff = +static struct psiconv_fileformat_s ff = { "HTML4", "HTML 4.0 with cascading style sheets",