Skip to content

Commit

Permalink
Backport of r120345.
Browse files Browse the repository at this point in the history
svn path=/branches/mono-2-2/mcs/; revision=120346
  • Loading branch information
grendello committed Dec 1, 2008
1 parent d44a27c commit 2023460
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
6 changes: 6 additions & 0 deletions mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2008-12-01 Marek Habersack <mhabersack@novell.com>

* Style.cs: WriteStyleAttributes must not use the fontinfo field
directly, it has to be done via the Font property. Fixes bug
#449793

2008-11-15 Marek Habersack <mhabersack@novell.com>

* ContentPlaceHolder.cs, Content.cs, FormViewPagerRow.cs,
Expand Down
23 changes: 12 additions & 11 deletions mcs/class/System.Web/System.Web.UI.WebControls/Style.cs
Original file line number Diff line number Diff line change
Expand Up @@ -487,32 +487,33 @@ void WriteStyleAttributes (HtmlTextWriter writer)

if (CheckBit ((int) Style.Styles.FontAll)) {
// Fonts are a bit weird
if (fontinfo.Name != string.Empty) {
s = fontinfo.Names[0];
for (int i = 1; i < fontinfo.Names.Length; i++)
s += "," + fontinfo.Names[i];
FontInfo font = Font;
if (font.Name != string.Empty) {
s = font.Names[0];
for (int i = 1; i < font.Names.Length; i++)
s += "," + font.Names[i];
writer.AddStyleAttribute (HtmlTextWriterStyle.FontFamily, s);
}

if (fontinfo.Bold)
if (font.Bold)
writer.AddStyleAttribute (HtmlTextWriterStyle.FontWeight, "bold");

if (fontinfo.Italic)
if (font.Italic)
writer.AddStyleAttribute (HtmlTextWriterStyle.FontStyle, "italic");

if (!fontinfo.Size.IsEmpty)
writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, fontinfo.Size.ToString());
if (!font.Size.IsEmpty)
writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, font.Size.ToString());

// These styles are munged into a attribute decoration
s = string.Empty;

if (fontinfo.Overline)
if (font.Overline)
s += "overline ";

if (fontinfo.Strikeout)
if (font.Strikeout)
s += "line-through ";

if (fontinfo.Underline)
if (font.Underline)
s += "underline ";

s = (s != "") ? s : AlwaysRenderTextDecoration ? "none" : "";
Expand Down

0 comments on commit 2023460

Please sign in to comment.