]> git.saurik.com Git - wxWidgets.git/commitdiff
The style listbox now takes into account the style background colour if specified.
authorJulian Smart <julian@anthemion.co.uk>
Wed, 12 Jun 2013 09:51:32 +0000 (09:51 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 12 Jun 2013 09:51:32 +0000 (09:51 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextstyles.cpp

index 3cfec1ff071926d95524d0d85766aec5b4f27026..da733e121eba1776fcfeda4fcc393cda7a636cc7 100644 (file)
@@ -740,11 +740,20 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
     if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
         isCentred = true;
 
     if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
         isCentred = true;
 
+    str << wxT("<html><head></head>");
+    str << wxT("<body");
+    if (attr.GetBackgroundColour().Ok())
+        str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\"");
+    str << wxT(">");
+
     if (isCentred)
         str << wxT("<center>");
 
     if (isCentred)
         str << wxT("<center>");
 
+    str << wxT("<table");
+    if (attr.GetBackgroundColour().Ok())
+        str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\"");
 
 
-    str << wxT("<table><tr>");
+    str << wxT("><tr>");
 
     if (attr.GetLeftIndent() > 0)
     {
 
     if (attr.GetLeftIndent() > 0)
     {
@@ -837,6 +846,9 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
     if (attr.GetTextColour().IsOk())
         str << wxT(" color=\"#") << ColourToHexString(attr.GetTextColour()) << wxT("\"");
 
     if (attr.GetTextColour().IsOk())
         str << wxT(" color=\"#") << ColourToHexString(attr.GetTextColour()) << wxT("\"");
 
+    if (attr.GetBackgroundColour().Ok())
+        str << wxT(" bgcolor=\"#") << ColourToHexString(attr.GetBackgroundColour()) << wxT("\"");
+
     str << wxT(">");
 
     bool hasBold = false;
     str << wxT(">");
 
     bool hasBold = false;
@@ -876,6 +888,7 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
     if (isCentred)
         str << wxT("</center>");
 
     if (isCentred)
         str << wxT("</center>");
 
+    str << wxT("</body></html>");
     return str;
 }
 
     return str;
 }