summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-09-12 15:01:39 +0200
committerjcid <devnull@localhost>2008-09-12 15:01:39 +0200
commitb4a7fddab9a30824c5c2bdfdf24e969938e5ed4e (patch)
tree77ca1730dd2a745992e07be5f422e6afd34cbec4 /src
parent171cd08291a2b2f9c212548f8a19c33bcc9ff2e6 (diff)
- Minor size optimization.
Diffstat (limited to 'src')
-rw-r--r--src/html.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/html.cc b/src/html.cc
index 3817dd20..9e69a3d9 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -295,30 +295,35 @@ void a_Html_tag_set_align_attr(DilloHtml *html,
const char *align, *charattr;
if ((align = a_Html_get_attr(html, tag, tagsize, "align"))) {
+ Style *old_style = S_TOP(html)->style;
+ StyleAttrs style_attrs = *old_style;
+
if (dStrcasecmp (align, "left") == 0)
- HTML_SET_TOP_ATTR (html, textAlign, TEXT_ALIGN_LEFT);
+ style_attrs.textAlign = TEXT_ALIGN_LEFT;
else if (dStrcasecmp (align, "right") == 0)
- HTML_SET_TOP_ATTR (html, textAlign, TEXT_ALIGN_RIGHT);
+ style_attrs.textAlign = TEXT_ALIGN_RIGHT;
else if (dStrcasecmp (align, "center") == 0)
- HTML_SET_TOP_ATTR (html, textAlign, TEXT_ALIGN_CENTER);
+ style_attrs.textAlign = TEXT_ALIGN_CENTER;
else if (dStrcasecmp (align, "justify") == 0)
- HTML_SET_TOP_ATTR (html, textAlign, TEXT_ALIGN_JUSTIFY);
+ style_attrs.textAlign = TEXT_ALIGN_JUSTIFY;
else if (dStrcasecmp (align, "char") == 0) {
/* todo: Actually not supported for <p> etc. */
- HTML_SET_TOP_ATTR (html, textAlign, TEXT_ALIGN_STRING);
+ style_attrs.textAlign = TEXT_ALIGN_STRING;
if ((charattr = a_Html_get_attr(html, tag, tagsize, "char"))) {
if (charattr[0] == 0)
/* todo: ALIGN=" ", and even ALIGN="&32;" will reult in
* an empty string (don't know whether the latter is
* correct, has to be clarified with the specs), so
* that for empty strings, " " is assumed. */
- HTML_SET_TOP_ATTR (html, textAlignChar, ' ');
+ style_attrs.textAlignChar = ' ';
else
- HTML_SET_TOP_ATTR (html, textAlignChar, charattr[0]);
+ style_attrs.textAlignChar = charattr[0];
} else
/* todo: Examine LANG attr of <html>. */
- HTML_SET_TOP_ATTR (html, textAlignChar, '.');
+ style_attrs.textAlignChar = '.';
}
+ S_TOP(html)->style = Style::create (HT2LT(html), &style_attrs);
+ old_style->unref ();
}
}