LCL-GTK2: Fix TMemo.SelText. Issue #32583, patch from accorp.

git-svn-id: trunk@56138 -
This commit is contained in:
juha 2017-10-20 21:02:42 +00:00
parent 8095d05aee
commit cf9ad3cd97
2 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,7 @@ type
public
//property Sorted: boolean read FSorted write SetSorted;
property Owner: TWinControl read FOwner;
property QueueCursorMovePos: Integer read FQueueCursorMove;
property QueueSelLength: Integer read FQueueSelLength;
end;
{$ELSE}

View File

@ -328,6 +328,7 @@ end;
class function TGtk2WSCustomMemo.GetSelStart(const ACustomEdit: TCustomEdit
): integer;
var
MemoStrings: TGtk2MemoStrings;
TextView: PGtkTextView;
TextBuffer: PGtkTextBuffer;
TextMark: PGtkTextMark;
@ -339,6 +340,11 @@ begin
if not WSCheckHandleAllocated(ACustomEdit, 'GetSelStart') then
Exit;
MemoStrings := TCustomMemo(ACustomEdit).Lines as TGtk2MemoStrings;
Result := MemoStrings.QueueCursorMovePos;
if Result > 0 then
Exit;
TextView := PGtkTextView(GetWidgetInfo({%H-}Pointer(ACustomEdit.Handle), False)^.CoreWidget);
TextBuffer := gtk_text_view_get_buffer(TextView);
TextMark := gtk_text_buffer_get_insert(TextBuffer);