- wxString color(thisStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX));
- style += wxString::Format(wxT(" color=\"%s\""), color.c_str());
+ style += wxT(" style=\"");
+
+ if (bTextColourChanged)
+ {
+ wxString color(thisStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX));
+ style += wxString::Format(wxT("color: %s"), color.c_str());
+ }
+ if (bTextColourChanged && bBackgroundColourChanged)
+ style += wxT(";");
+ if (bBackgroundColourChanged)
+ {
+ wxString color(thisStyle.GetBackgroundColour().GetAsString(wxC2S_HTML_SYNTAX));
+ style += wxString::Format(wxT("background-color: %s"), color.c_str());
+ }
+
+ style += wxT("\"");