mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-24 14:22:40 -06:00
RichText: Fixed underline problem, .uppbox
This commit is contained in:
parent
2e003b932e
commit
e2c50183e6
4 changed files with 27 additions and 27 deletions
|
|
@ -17,8 +17,6 @@ String HtmlFontStyle(Font f, Font base)
|
|||
style << (f.IsBold() ? "font-weight:bold;" : "font-weight:normal;");
|
||||
if(f.IsItalic() != base.IsItalic())
|
||||
style << (f.IsItalic() ? "font-style:italic;" : "font-style:normal;");
|
||||
if(f.IsUnderline() != base.IsUnderline())
|
||||
style << (f.IsUnderline() ? "text-decoration:underline;" : "text-decoration:none;");
|
||||
return style;
|
||||
}
|
||||
|
||||
|
|
@ -33,18 +31,6 @@ String HtmlFontStyle(Font f)
|
|||
style << Sprintf("font-size:%dpt;", f.GetHeight() * 72 / 600);
|
||||
style << (f.IsBold() ? "font-weight:bold;" : "font-weight:normal;");
|
||||
style << (f.IsItalic() ? "font-style:italic;" : "font-style:normal;");
|
||||
if(f.IsUnderline() || f.IsStrikeout()) {
|
||||
style << "text-decoration:";
|
||||
if(f.IsUnderline())
|
||||
style << "underline";
|
||||
if(f.IsStrikeout()) {
|
||||
if(f.IsUnderline())
|
||||
style << ' ';
|
||||
style << "line-through";
|
||||
}
|
||||
}
|
||||
else
|
||||
style << "text-decoration:none;";
|
||||
return style;
|
||||
}
|
||||
|
||||
|
|
@ -270,9 +256,13 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
|
|||
html << "<sub>";
|
||||
endtag = "</sub>" + endtag;
|
||||
}
|
||||
if(part.format.IsUnderline()) {
|
||||
html << "<u>";
|
||||
endtag = "</u>" + endtag;
|
||||
}
|
||||
if(part.format.IsStrikeout()) {
|
||||
html << "<strike>";
|
||||
endtag = "</strike>" + endtag;
|
||||
html << "<del>";
|
||||
endtag = "</del>" + endtag;
|
||||
}
|
||||
if(part.format.capitals) {
|
||||
html << "<span style=\"font-variant: small-caps;\">";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue