diff options
-rw-r--r-- | include/mupdf/html.h | 19 | ||||
-rw-r--r-- | source/html/css-apply.c | 8 | ||||
-rw-r--r-- | source/html/html-layout.c | 12 |
3 files changed, 21 insertions, 18 deletions
diff --git a/include/mupdf/html.h b/include/mupdf/html.h index 8632ed5e..c3dd7977 100644 --- a/include/mupdf/html.h +++ b/include/mupdf/html.h @@ -155,14 +155,17 @@ struct fz_css_style_s fz_css_number padding[4]; fz_css_number border_width[4]; fz_css_number text_indent; - char visibility; - char white_space; - char text_align; - char vertical_align; - char list_style_type; - char border_style[4]; - char page_break_before; - char page_break_after; + unsigned int visibility : 2; + unsigned int white_space : 3; + unsigned int text_align : 2; + unsigned int vertical_align : 3; + unsigned int list_style_type : 4; + unsigned int page_break_before : 3; + unsigned int page_break_after : 3; + unsigned int border_style_0 : 1; + unsigned int border_style_1 : 1; + unsigned int border_style_2 : 1; + unsigned int border_style_3 : 1; fz_css_number line_height; fz_css_color background_color; fz_css_color border_color[4]; diff --git a/source/html/css-apply.c b/source/html/css-apply.c index 62b06288..af2a3a45 100644 --- a/source/html/css-apply.c +++ b/source/html/css-apply.c @@ -1269,10 +1269,10 @@ fz_apply_css_style(fz_context *ctx, fz_html_font_set *set, fz_css_style *style, style->color = color_from_property(match, "color", black); style->background_color = color_from_property(match, "background-color", transparent); - style->border_style[0] = border_style_from_property(match, "border-top-style"); - style->border_style[1] = border_style_from_property(match, "border-right-style"); - style->border_style[2] = border_style_from_property(match, "border-bottom-style"); - style->border_style[3] = border_style_from_property(match, "border-left-style"); + style->border_style_0 = border_style_from_property(match, "border-top-style"); + style->border_style_1 = border_style_from_property(match, "border-right-style"); + style->border_style_2 = border_style_from_property(match, "border-bottom-style"); + style->border_style_3 = border_style_from_property(match, "border-left-style"); style->border_color[0] = color_from_property(match, "border-top-color", style->color); style->border_color[1] = color_from_property(match, "border-right-color", style->color); diff --git a/source/html/html-layout.c b/source/html/html-layout.c index df119b1a..a7642981 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -1338,10 +1338,10 @@ static float layout_block(fz_context *ctx, fz_html *box, fz_html *top, float pag padding[2] = fz_from_css_number(style->padding[2], em, top->w); padding[3] = fz_from_css_number(style->padding[3], em, top->w); - border[0] = style->border_style[0] ? fz_from_css_number(style->border_width[0], em, top->w) : 0; - border[1] = style->border_style[1] ? fz_from_css_number(style->border_width[1], em, top->w) : 0; - border[2] = style->border_style[2] ? fz_from_css_number(style->border_width[2], em, top->w) : 0; - border[3] = style->border_style[3] ? fz_from_css_number(style->border_width[3], em, top->w) : 0; + border[0] = style->border_style_0 ? fz_from_css_number(style->border_width[0], em, top->w) : 0; + border[1] = style->border_style_1 ? fz_from_css_number(style->border_width[1], em, top->w) : 0; + border[2] = style->border_style_2 ? fz_from_css_number(style->border_width[2], em, top->w) : 0; + border[3] = style->border_style_3 ? fz_from_css_number(style->border_width[3], em, top->w) : 0; /* TODO: remove 'vertical' margin adjustments across automatic page breaks */ @@ -2008,8 +2008,8 @@ fz_print_css_style(fz_context *ctx, fz_css_style *style, int boxtype, int n) printf("%g%c ", style->border_width[2].value, style->border_width[2].unit); printf("%g%c\n", style->border_width[3].value, style->border_width[3].unit); indent(n); printf("border_style %d %d %d %d\n", - style->border_style[0], style->border_style[1], - style->border_style[2], style->border_style[3]); + style->border_style_0, style->border_style_1, + style->border_style_2, style->border_style_3); indent(n); printf("text_indent %g%c\n", style->text_indent.value, style->text_indent.unit); indent(n); printf("white_space %d\n", style->white_space); indent(n); printf("text_align %d\n", style->text_align); |