Don't ask for wxTextAttr colour if it doesn't have any in text sample.
This fixes an assert which could happen when showing the rich text editor. Also show the colour in a more readable form if possible. Closes #12950. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2de611305e
commit
ca746004af
@ -1861,9 +1861,20 @@ void RichTextFrame::OnIdle(wxIdleEvent& WXUNUSED(event))
|
||||
alignment = wxT("left-aligned");
|
||||
else if (attr.GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED)
|
||||
alignment = wxT("justified");
|
||||
msg.Printf( "Facename: %s, wxColour(%d, %d, %d), %s", facename,
|
||||
attr.GetTextColour().Red(), attr.GetTextColour().Green(), attr.GetTextColour().Blue(),
|
||||
alignment );
|
||||
|
||||
msg.Printf("Facename: %s", facename);
|
||||
|
||||
if (attr.HasTextColour())
|
||||
{
|
||||
msg += wxString::Format(", colour: %s",
|
||||
attr.GetTextColour().GetAsString());
|
||||
}
|
||||
else
|
||||
{
|
||||
msg += ", no colour";
|
||||
}
|
||||
|
||||
msg << ", " << alignment;
|
||||
|
||||
if (attr.HasFont())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user