diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index d7975dde5e..92360ca742 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -785,8 +785,9 @@ void wxTextCtrl::GetSelection(long* from, long* to) const if (!(GTK_EDITABLE(m_text)->has_selection)) { - if (from) *from = 0; - if (to) *to = 0; + long i = GetInsertionPoint(); + if (from) *from = i; + if (to) *to = i; return; } diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index d7975dde5e..92360ca742 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -785,8 +785,9 @@ void wxTextCtrl::GetSelection(long* from, long* to) const if (!(GTK_EDITABLE(m_text)->has_selection)) { - if (from) *from = 0; - if (to) *to = 0; + long i = GetInsertionPoint(); + if (from) *from = i; + if (to) *to = i; return; }