diff options
-rw-r--r-- | src/html.cc | 9 | ||||
-rw-r--r-- | src/html_common.hh | 5 | ||||
-rw-r--r-- | src/styleengine.cc | 10 | ||||
-rw-r--r-- | src/styleengine.hh | 3 |
4 files changed, 13 insertions, 14 deletions
diff --git a/src/html.cc b/src/html.cc index eff2c498..4b7ea9b2 100644 --- a/src/html.cc +++ b/src/html.cc @@ -265,6 +265,7 @@ static int Html_add_new_linkimage(DilloHtml *html, void a_Html_set_top_font(DilloHtml *html, const char *name, int size, int BI, int BImask) { +#if 0 FontAttrs font_attrs; font_attrs = *html->styleEngine->style ()->font; @@ -279,6 +280,7 @@ void a_Html_set_top_font(DilloHtml *html, const char *name, int size, HTML_SET_TOP_ATTR (html, font, Font::create (HT2LT(html), &font_attrs)); +#endif } /* @@ -2464,7 +2466,7 @@ static void Html_add_anchor(DilloHtml *html, const char *name) static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize) { DilloUrl *url; - CssPropertyList *props; + CssPropertyList props; CssProperty::Value propValue; const char *attrbuf; @@ -2480,10 +2482,9 @@ static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize) url = a_Html_url_new(html, attrbuf, NULL, 0); dReturn_if_fail ( url != NULL ); - props = new CssPropertyList (); propValue.x_link = Html_set_new_link(html, &url); - props->set (CssProperty::PROPERTY_X_LINK, propValue); - html->styleEngine->setNonCssProperties (props); + props.set (CssProperty::PROPERTY_X_LINK, propValue); + html->styleEngine->setNonCssProperties (&props); } if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "name"))) { diff --git a/src/html_common.hh b/src/html_common.hh index d05ac495..28ce5231 100644 --- a/src/html_common.hh +++ b/src/html_common.hh @@ -38,6 +38,7 @@ * Change one toplevel attribute. var should be an identifier. val is * only evaluated once, so you can safely use a function call for it. */ +#if 0 #define HTML_SET_TOP_ATTR(html, var, val) \ do { \ StyleAttrs style_attrs; \ @@ -50,7 +51,9 @@ Style::create (HT2LT(html), &style_attrs); \ old_style->unref (); \ } while (FALSE) - +#else +#define HTML_SET_TOP_ATTR(html, var, val) +#endif /* * Typedefs */ diff --git a/src/styleengine.cc b/src/styleengine.cc index 7a87fbb6..7446e073 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -53,7 +53,6 @@ void StyleEngine::startElement (int tag, const char *id, const char *klass, stack->increase (); Node *n = stack->getRef (stack->size () - 1); n->style = NULL; - n->nonCssProperties = NULL; n->depth = stack->size (); n->tag = tag; n->id = id; @@ -62,7 +61,7 @@ void StyleEngine::startElement (int tag, const char *id, const char *klass, } void StyleEngine::setNonCssProperties (CssPropertyList *props) { - stack->getRef (stack->size () - 1)->nonCssProperties = props; + style0 (props); // evaluate now, so caller can free props } void StyleEngine::endElement (int tag) { @@ -72,8 +71,6 @@ void StyleEngine::endElement (int tag) { Node *n = stack->getRef (stack->size () - 1); if (n->style) n->style->unref (); - if (n->nonCssProperties) - delete n->nonCssProperties; stack->setSize (stack->size () - 1); } @@ -128,15 +125,14 @@ void StyleEngine::apply (StyleAttrs *attrs, CssPropertyList *props) { attrs->font = Font::create (layout, &fontAttrs); } -Style * StyleEngine::style0 () { +Style * StyleEngine::style0 (CssPropertyList *nonCssProperties) { CssPropertyList props; CssPropertyList *tagStyleProps = CssPropertyList::parse ( stack->getRef (stack->size () - 1)->styleAttribute); StyleAttrs attrs = *stack->getRef (stack->size () - 2)->style; - cssContext->apply (&props, this, tagStyleProps, - stack->getRef (stack->size () - 1)->nonCssProperties); + cssContext->apply (&props, this, tagStyleProps, nonCssProperties); apply (&attrs, &props); diff --git a/src/styleengine.hh b/src/styleengine.hh index 39591633..218d874b 100644 --- a/src/styleengine.hh +++ b/src/styleengine.hh @@ -10,7 +10,6 @@ class StyleEngine : public Doctree { class Node : public DoctreeNode { public: dw::core::style::Style *style; - CssPropertyList *nonCssProperties; const char *styleAttribute; }; @@ -18,7 +17,7 @@ class StyleEngine : public Doctree { lout::misc::SimpleVector <Node> *stack; CssContext *cssContext; - dw::core::style::Style *style0 (); + dw::core::style::Style *style0 (CssPropertyList *nonCssProperties = NULL); void apply (dw::core::style::StyleAttrs *attrs, CssPropertyList *props); public: |