X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/80a4659776396941bbf7b08615dd60d35dbc47b5..ad653fa23069c5d9378247084f03c9a718c3ad62:/src/richtext/richtextstyles.cpp?ds=sidebyside
diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp
index 60c975478e..da733e121e 100644
--- a/src/richtext/richtextstyles.cpp
+++ b/src/richtext/richtextstyles.cpp
@@ -706,7 +706,11 @@ int wxRichTextStyleListBox::SetStyleSelection(const wxString& name)
{
int i = GetIndexForStyle(name);
if (i > -1)
+ {
SetSelection(i);
+ if (!IsVisible(i))
+ ScrollToRow(i);
+ }
return i;
}
@@ -736,11 +740,20 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
if (attr.HasAlignment() && attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
isCentred = true;
+ str << wxT("
");
+ str << wxT("");
+
if (isCentred)
str << wxT("");
+ str << wxT("");
+ str << wxT(">
");
if (attr.GetLeftIndent() > 0)
{
@@ -833,15 +846,18 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
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;
bool hasItalic = false;
bool hasUnderline = false;
- if (attr.GetFontWeight() == wxBOLD)
+ if (attr.GetFontWeight() == wxFONTWEIGHT_BOLD)
hasBold = true;
- if (attr.GetFontStyle() == wxITALIC)
+ if (attr.GetFontStyle() == wxFONTSTYLE_ITALIC)
hasItalic = true;
if (attr.GetFontUnderlined())
hasUnderline = true;
@@ -872,6 +888,7 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons
if (isCentred)
str << wxT("");
+ str << wxT("");
return str;
}