X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=dump.c;h=991dd366b4515bae2da7fdb4bc243100bf99473a;hb=9f2d5103848c48c3c49b5c0d11f1b2506ab5487e;hp=205167951ca20dab22cf99d3b8143111d5d59abb;hpb=55514d1999dd218a25028cb8bd6a7f608b52c2ef;p=pspp diff --git a/dump.c b/dump.c index 205167951c..991dd366b4 100644 --- a/dump.c +++ b/dump.c @@ -384,18 +384,13 @@ dump_counted_string(void) static void dump_style(FILE *stream) { - match_byte(1); - match_byte(0); - match_byte(0); - match_byte(0); - match_byte_assert(1); + for (int i = 0; i < 4; i++) + printf (" %d", get_byte()); char *fg = get_string(); /* foreground */ char *bg = get_string(); /* background */ char *font = get_string(); /* font */ - int size = data[pos]; - if (!match_byte(14)) - match_byte_assert(12); /* size? */ - fprintf(stream, " fgcolor=\"%s\" bgcolor=\"%s\" font=\"%s\" size=\"%d\"", + int size = get_byte() * (72. / 96.); + fprintf(stream, " fgcolor=\"%s\" bgcolor=\"%s\" font=\"%s\" size=\"%dpt\"", fg, bg, font, size); } @@ -477,21 +472,26 @@ dump_value_modifier(FILE *stream) match_byte_assert(0x58); if (match_byte(0x31)) { - /* Only two SPV files have anything like this, so it's hard to - generalize. */ - match_u32_assert(0); - match_u32_assert(0); - match_u32_assert(0); - match_u32_assert(0); - match_byte_assert(1); - match_byte_assert(0); - if (!match_byte(8) && !match_byte(1)) - match_byte_assert(2); - match_byte_assert(0); - match_byte_assert(8); - match_byte_assert(0); - match_byte_assert(10); - match_byte_assert(0); + uint32_t halign = get_u32(); + printf (" halign=\"%s\"", + halign == 0 ? "center" + : halign == 2 ? "left" + : halign == 4 ? "right" + : halign == 6 ? "decimal" + : halign == 0xffffffad ? "mixed" + : ""); + int valign = get_u32(); + printf (" valign=\"%s\"", + valign == 0 ? "center" + : valign == 1 ? "top" + : valign == 3 ? "bottom" + : ""); + printf (" %g", get_double()); + int l = get_u16(); + int r = get_u16(); + int t = get_u16(); + int b = get_u16(); + printf (" margins=\"%d %d %d %d\"", l, r, t, b); } else match_byte_assert(0x58);