From 1490b52a6b96b6a69a0c4fe9e0515dc717425128 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 22 Mar 2012 09:34:34 +0000 Subject: NetSurf options rework (a=vince r=daniels,jmb) svn path=/trunk/netsurf/; revision=13548 --- css/select.c | 11 ++++++----- css/utils.c | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'css') diff --git a/css/select.c b/css/select.c index c033ec142..b313a465e 100644 --- a/css/select.c +++ b/css/select.c @@ -329,7 +329,7 @@ css_error nscss_compute_font_size(void *pw, const css_hint *parent, /* Grab parent size, defaulting to medium if none */ if (parent == NULL) { parent_size.value = FDIV(FMUL(factors[CSS_FONT_SIZE_MEDIUM - 1], - INTTOFIX(option_font_size)), + INTTOFIX(nsoption_int(font_size))), INTTOFIX(10)); parent_size.unit = CSS_UNIT_PT; } else { @@ -346,7 +346,7 @@ css_error nscss_compute_font_size(void *pw, const css_hint *parent, if (size->status < CSS_FONT_SIZE_LARGER) { /* Keyword -- simple */ size->data.length.value = FDIV(FMUL(factors[size->status - 1], - INTTOFIX(option_font_size)), + INTTOFIX(nsoption_int(font_size))), F_10); size->data.length.unit = CSS_UNIT_PT; } else if (size->status == CSS_FONT_SIZE_LARGER) { @@ -816,8 +816,9 @@ css_error node_has_id(void *pw, void *node, *match = false; - if (p->id != NULL) + if (p->id != NULL) { lwc_string_isequal(name, p->id, match); + } return CSS_OK; } @@ -2192,7 +2193,7 @@ css_error ua_default_for_property(void *pw, uint32_t property, css_hint *hint) hint->status = CSS_COLOR_COLOR; } else if (property == CSS_PROP_FONT_FAMILY) { hint->data.strings = NULL; - switch (option_font_default) { + switch (nsoption_int(font_default)) { case PLOT_FONT_FAMILY_SANS_SERIF: hint->status = CSS_FONT_FAMILY_SANS_SERIF; break; @@ -2643,7 +2644,7 @@ bool parse_font_size(const char *size, uint8_t *val, if (value == 7) { /* Manufacture xxx-large */ - *len = FDIV(FMUL(INTTOFIX(3), INTTOFIX(option_font_size)), + *len = FDIV(FMUL(INTTOFIX(3), INTTOFIX(nsoption_int(font_size))), F_10); } else { /* Len is irrelevant */ diff --git a/css/utils.c b/css/utils.c index 422d0fbb1..d5acf4932 100644 --- a/css/utils.c +++ b/css/utils.c @@ -91,8 +91,8 @@ css_fixed nscss_len2px(css_fixed length, css_unit unit, font_size = nscss_len2pt(font_size, font_unit); /* Clamp to configured minimum */ - if (font_size < FDIV(INTTOFIX(option_font_min_size), F_10)) { - font_size = FDIV(INTTOFIX(option_font_min_size), F_10); + if (font_size < FDIV(INTTOFIX(nsoption_int(font_min_size)), F_10)) { + font_size = FDIV(INTTOFIX(nsoption_int(font_min_size)), F_10); } /* Convert to pixels (manually, to maximise precision) -- cgit v1.2.3