Attempt to fix out-of-range error in TMainForm.tabsetQueryMouseMove

This commit is contained in:
Ansgar Becker
2020-12-14 18:24:30 +01:00
parent 8f826e814d
commit f95fa2759a

View File

@ -7874,6 +7874,7 @@ var
Tabs: TTabSet;
Rect: TRect;
Org: TPoint;
QueryTab: TQueryTab;
ResultTab: TResultTab;
HintSQL: TStringList;
begin
@ -7889,12 +7890,15 @@ begin
// Check if user wants these balloon hints
if not AppSettings.ReadBool(asHintsOnResultTabs) then
Exit;
QueryTab := ActiveQueryTab;
if idx >= QueryTab.ResultTabs.Count then
Exit;
// Make SQL readable for the tooltip balloon. WrapText() is unsuitable here.
// See issue #2014
// Also, wee need to work around the awful looking balloon text:
// http://qc.embarcadero.com/wc/qcmain.aspx?d=73771
ResultTab := ActiveQueryTab.ResultTabs[idx];
ResultTab := QueryTab.ResultTabs[idx];
HintSQL := TStringList.Create;
HintSQL.Text := Trim(ResultTab.Results.SQL);
for i:=0 to HintSQL.Count-1 do begin