Fixed pasting inefficiency
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f6f0ef852c
commit
c21f3211ea
@ -5603,9 +5603,20 @@ bool wxRichTextBuffer::PasteFromClipboard(long position)
|
|||||||
wxTextDataObject data;
|
wxTextDataObject data;
|
||||||
wxTheClipboard->GetData(data);
|
wxTheClipboard->GetData(data);
|
||||||
wxString text(data.GetText());
|
wxString text(data.GetText());
|
||||||
text.Replace(_T("\r\n"), _T("\n"));
|
#ifdef __WXMSW__
|
||||||
|
wxString text2;
|
||||||
InsertTextWithUndo(position+1, text, GetRichTextCtrl());
|
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;
|
success = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user