Only write text colour if the colour is valid

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48598 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-09-07 14:15:46 +00:00
parent d230db40d0
commit 721fbc2f1c

View File

@@ -326,9 +326,10 @@ void wxRichTextHTMLHandler::OutputFont(const wxTextAttrEx& style, wxTextOutputSt
{ {
if (style.HasFont()) if (style.HasFont())
{ {
stream << wxString::Format(wxT("<font face=\"%s\" size=\"%ld\" color=\"%s\" >"), stream << wxString::Format(wxT("<font face=\"%s\" size=\"%ld\""), style.GetFont().GetFaceName().c_str(), PtToSize(style.GetFont().GetPointSize()));
style.GetFont().GetFaceName().c_str(), PtToSize(style.GetFont().GetPointSize()), if (style.HasTextColour())
style.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX).c_str()); stream << wxString::Format(wxT(" color=\"%s\""), style.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX).c_str());
stream << wxT(" >");
} }
} }