Applied #12601: Background color when saving wxRichText to HTML file
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -196,10 +196,27 @@ void wxRichTextHTMLHandler::BeginCharacterFormatting(const wxRichTextAttr& curre
|
|||||||
}
|
}
|
||||||
if (thisStyle.GetFontSize() != currentStyle.GetFontSize())
|
if (thisStyle.GetFontSize() != currentStyle.GetFontSize())
|
||||||
style += wxString::Format(wxT(" size=\"%ld\""), PtToSize(thisStyle.GetFontSize()));
|
style += wxString::Format(wxT(" size=\"%ld\""), PtToSize(thisStyle.GetFontSize()));
|
||||||
if (thisStyle.GetTextColour() != currentStyle.GetTextColour() )
|
|
||||||
|
bool bTextColourChanged = (thisStyle.GetTextColour() != currentStyle.GetTextColour());
|
||||||
|
bool bBackgroundColourChanged = (thisStyle.GetBackgroundColour() != currentStyle.GetBackgroundColour());
|
||||||
|
if (bTextColourChanged || bBackgroundColourChanged)
|
||||||
{
|
{
|
||||||
wxString color(thisStyle.GetTextColour().GetAsString(wxC2S_HTML_SYNTAX));
|
style += wxT(" style=\"");
|
||||||
style += wxString::Format(wxT(" color=\"%s\""), color.c_str());
|
|
||||||
|
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("\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (style.size())
|
if (style.size())
|
||||||
|
Reference in New Issue
Block a user