]> git.saurik.com Git - wxWidgets.git/commitdiff
Layout correction
authorJulian Smart <julian@anthemion.co.uk>
Mon, 19 Feb 2007 18:32:07 +0000 (18:32 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 19 Feb 2007 18:32:07 +0000 (18:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index 47f1e8d8e3082036cd07b53768fcbf39ed03083c..41351256a677b3e59a4dfab5ab463c1d25c7dc4f 100644 (file)
@@ -4398,24 +4398,7 @@ bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, c
 /// Lay the item out
 bool wxRichTextPlainText::Layout(wxDC& dc, const wxRect& WXUNUSED(rect), int WXUNUSED(style))
 {
-    wxRichTextParagraph* para = wxDynamicCast(GetParent(), wxRichTextParagraph);
-    wxASSERT (para != NULL);
-
-    wxTextAttrEx textAttr(para ? para->GetCombinedAttributes(GetAttributes()) : GetAttributes());
-
-    if (textAttr.GetFont().Ok())
-        dc.SetFont(textAttr.GetFont());
-
-    wxString str = m_text;    
-    if (textAttr.HasTextEffects() && (textAttr.GetTextEffects() & wxTEXT_ATTR_EFFECT_CAPITALS))
-        str.MakeUpper();
-
-    wxString toReplace = wxRichTextLineBreakChar;
-    str.Replace(toReplace, wxT(" "));
-
-    wxCoord w, h;
-    dc.GetTextExtent(str, & w, & h, & m_descent);
-    m_size = wxSize(w, dc.GetCharHeight());
+    GetRangeSize(GetRange(), m_size, m_descent, dc, 0, wxPoint(0, 0));
 
     return true;
 }