Gtk2: fixed bug where combobox returned caret position for selection length. issue #19081

git-svn-id: trunk@30185 -
This commit is contained in:
zeljko 2011-04-04 16:11:17 +00:00
parent b92bfd76d2
commit ecc941f2f6

View File

@ -1609,9 +1609,10 @@ begin
// if the combo is an editable ...
Entry := GetComboBoxEntry(WidgetInfo^.CoreWidget);
if Entry<>nil then begin
if gtk_editable_get_selection_bounds(PGtkEditable(Entry), @AStart, @AEnd) = False then
Exit(gtk_editable_get_position(PGtkEditable(Entry)));
if Entry<>nil then
begin
if not gtk_editable_get_selection_bounds(PGtkEditable(Entry), @AStart, @AEnd) then
Exit(0);
Result := ABS(AStart - AEnd);
end;
end;