fix crash when copying empty selection to clipboard (#4783)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -523,6 +523,9 @@ void ScintillaWX::Paste() {
|
|||||||
|
|
||||||
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
void ScintillaWX::CopyToClipboard(const SelectionText& st) {
|
||||||
#if wxUSE_CLIPBOARD
|
#if wxUSE_CLIPBOARD
|
||||||
|
if ( !st.len )
|
||||||
|
return;
|
||||||
|
|
||||||
wxTheClipboard->UsePrimarySelection(false);
|
wxTheClipboard->UsePrimarySelection(false);
|
||||||
if (wxTheClipboard->Open()) {
|
if (wxTheClipboard->Open()) {
|
||||||
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
|
wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1));
|
||||||
|
Reference in New Issue
Block a user