aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-11-08 17:32:21 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2008-11-08 17:32:21 +0100
commit3da3f1077c994fdd4730c735aa11853acef3b74e (patch)
tree73610d2fc04ebbc9cb86bcdcfd144d5c6a6bbf78 /src
parentdc012030ac53bfc77f2c03af8d4e672d4cb5ef05 (diff)
convert Html_tag_open_font()
Diffstat (limited to 'src')
-rw-r--r--src/css.hh4
-rw-r--r--src/html.cc39
2 files changed, 15 insertions, 28 deletions
diff --git a/src/css.hh b/src/css.hh
index 991a926e..d28e78eb 100644
--- a/src/css.hh
+++ b/src/css.hh
@@ -8,7 +8,7 @@ class CssProperty {
public:
typedef union {
int intVal;
- char *strVal;
+ const char *strVal;
} Value;
typedef enum {
@@ -123,7 +123,7 @@ class CssPropertyList : public lout::misc::SimpleVector <CssProperty> {
static CssPropertyList *parse (const char *buf);
void set (CssProperty::Name name, CssProperty::Value value);
- void set (CssProperty::Name name, char *value) {
+ void set (CssProperty::Name name, const char *value) {
CssProperty::Value v;
v.strVal = value;
set (name, v);
diff --git a/src/html.cc b/src/html.cc
index fcc769d0..711abe01 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -1915,39 +1915,26 @@ static void Html_tag_open_br(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_tag_open_font(DilloHtml *html, const char *tag, int tagsize)
{
- StyleAttrs style_attrs;
- Style *old_style;
/*Font font;*/
const char *attrbuf;
int32_t color;
+ CssPropertyList props;
- if (!prefs.force_my_colors) {
- old_style = html->styleEngine->style ();
- style_attrs = *old_style;
-
- if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "color"))) {
- if (prefs.contrast_visited_color && html->InVisitedLink) {
- color = html->visited_color;
- } else {
- /* use the tag-specified color */
- color = a_Html_color_parse(html, attrbuf,
- style_attrs.color->getColor());
- style_attrs.color = Color::createSimple (HT2LT(html), color);
- }
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "color"))) {
+ if (prefs.contrast_visited_color && html->InVisitedLink) {
+ color = html->visited_color;
+ } else {
+ /* use the tag-specified color */
+ color = a_Html_color_parse(html, attrbuf, -1);
}
+ if (color != -1)
+ props.set (CssProperty::CSS_PROPERTY_COLOR, color);
+ }
-#if 0
- //if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "face"))) {
- // font = *( style_attrs.font );
- // font.name = attrbuf;
- // style_attrs.font = a_Dw_style_font_new_from_list (&font);
- //}
-#endif
+ if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "face")))
+ props.set (CssProperty::CSS_PROPERTY_FONT_FAMILY, attrbuf);
-// html->styleEngine->style () =
-// Style::create (HT2LT(html), &style_attrs);
-// old_style->unref ();
- }
+ html->styleEngine->setNonCssProperties (&props);
}
/*