]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextbuffer.cpp
Optimization correction
[wxWidgets.git] / src / richtext / richtextbuffer.cpp
index 38de2d611a4def25d9965b601b4a486a948ef86c..ac3e1c43998eec2f71632a64df1dceb2d548136d 100644 (file)
@@ -61,6 +61,7 @@ inline void wxCheckSetFont(wxDC& dc, const wxFont& font)
             font1.GetFamily() == font.GetFamily() &&
             font1.GetStyle() == font.GetStyle() &&
             font1.GetWeight() == font.GetWeight() &&
+            font1.GetUnderlined() == font.GetUnderlined() &&
             font1.GetFaceName() == font.GetFaceName())
             return;
     }
@@ -5603,9 +5604,20 @@ bool wxRichTextBuffer::PasteFromClipboard(long position)
                 wxTextDataObject data;
                 wxTheClipboard->GetData(data);
                 wxString text(data.GetText());
-                text.Replace(_T("\r\n"), _T("\n"));
-
-                InsertTextWithUndo(position+1, text, GetRichTextCtrl());
+#ifdef __WXMSW__
+                wxString text2;
+                text2.Alloc(text.Length()+1);
+                size_t i;
+                for (i = 0; i < text.Length(); i++)
+                {
+                    wxChar ch = text[i];
+                    if (ch != wxT('\r'))
+                        text2 += ch;
+                }
+#else
+                wxString text2 = text;
+#endif
+                InsertTextWithUndo(position+1, text2, GetRichTextCtrl());
 
                 success = true;
             }