Fix calculation of wxStyledTextCtrl selection size in GetSelectedText().

Do the same changes as were done in r71540 to GetSelectedTextRaw() in
GetSelectedText() itself by modifying the code in gen_iface.py that generates
it.

Closes #14331.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-05-25 09:48:12 +00:00
parent fd5cfba711
commit 6094165c4e
2 changed files with 2 additions and 10 deletions

View File

@@ -509,11 +509,7 @@ methodOverrideMap = {
'wxString %s();', 'wxString %s();',
'''wxString %s() { '''wxString %s() {
long start; const int len = SendMsg(SCI_GETSELTEXT, 0, (sptr_t)0);
long end;
GetSelection(&start, &end);
int len = end - start;
if (!len) return wxEmptyString; if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+2); wxMemoryBuffer mbuf(len+2);

View File

@@ -1504,11 +1504,7 @@ bool wxStyledTextCtrl::GetModify() const
// Retrieve the selected text. // Retrieve the selected text.
wxString wxStyledTextCtrl::GetSelectedText() { wxString wxStyledTextCtrl::GetSelectedText() {
long start; const int len = SendMsg(SCI_GETSELTEXT, 0, (sptr_t)0);
long end;
GetSelection(&start, &end);
int len = end - start;
if (!len) return wxEmptyString; if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+2); wxMemoryBuffer mbuf(len+2);