From: Julian Smart Date: Fri, 17 Nov 2006 08:21:38 +0000 (+0000) Subject: Limit indentation in style listbox, and also show centring X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/380a5dd80316202b472967e898feba1386ea5345?ds=inline Limit indentation in style listbox, and also show centring git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index 7ecf846323..b66481a051 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -537,16 +537,30 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons { // TODO: indicate list format for list style types - wxString str(wxT("")); + wxString str; + + bool isCentred = false; + + if (def->GetStyle().HasAlignment() && def->GetStyle().GetAlignment() == wxTEXT_ALIGNMENT_CENTRE) + isCentred = true; + + if (isCentred) + str << wxT("
"); + + + str << wxT("
"); if (def->GetStyle().GetLeftIndent() > 0) { wxClientDC dc((wxWindow*) this); - str << wxT(""); + str << wxT(""); } - str << wxT("
"); + if (isCentred) + str << wxT(""); + else + str << wxT(""); #ifdef __WXMSW__ int size = 3; @@ -601,9 +615,16 @@ wxString wxRichTextStyleListBox::CreateHTML(wxRichTextStyleDefinition* def) cons if (hasBold) str << wxT(""); + if (isCentred) + str << wxT(""); + str << wxT(""); - str += wxT("
"); + str << wxT(""); + + if (isCentred) + str << wxT(""); + return str; }