From d740f112a5059c70178d840bcdad896a98919b3c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 15 Jun 2008 11:45:05 +0000 Subject: [PATCH] fix crash when copying empty selection to clipboard (#4783) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@54230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/src/stc/ScintillaWX.cpp | 2 ++ docs/changes.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 000db9a24b..d014cda891 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -537,6 +537,8 @@ void ScintillaWX::Paste() { void ScintillaWX::CopyToClipboard(const SelectionText& st) { #if wxUSE_CLIPBOARD + if ( !st.len ) + return; if (wxTheClipboard->Open()) { wxTheClipboard->UsePrimarySelection(false); wxString text = wxTextBuffer::Translate(stc2wx(st.s, st.len-1)); diff --git a/docs/changes.txt b/docs/changes.txt index 5bde916950..9c3b905aa6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -136,6 +136,7 @@ All (GUI): - wxHTML: preserve TAB characters when copying
 content to clipboard.
 - Set focus to wxCalendarCtrl when it is clicked.
 - Don't clear the list control when wxLC_[HV]RULES style is toggled.
+- Don't crash when Ctrl-Shift-T is pressed in empty wxStyledTextControl.
 
 All (Unix):