mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Follow up to r4266, issue #3051: Fix selection of the right routine type, based on the itemindex, not the combo box text.
This commit is contained in:
@ -288,7 +288,6 @@ type
|
||||
function ColorAdjustBrightness(Col: TColor; Shift: SmallInt): TColor;
|
||||
function ComposeOrderClause(Cols: TOrderColArray): String;
|
||||
procedure DeInitializeVTNodes(Sender: TBaseVirtualTree);
|
||||
function ListIndexByRegExpr(List: TStrings; Expression: String): Integer;
|
||||
function FindNode(VT: TVirtualStringTree; idx: Int64; ParentNode: PVirtualNode): PVirtualNode;
|
||||
procedure SelectNode(VT: TVirtualStringTree; idx: Int64; ParentNode: PVirtualNode=nil); overload;
|
||||
procedure SelectNode(VT: TVirtualStringTree; Node: PVirtualNode); overload;
|
||||
@ -1585,26 +1584,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function ListIndexByRegExpr(List: TStrings; Expression: String): Integer;
|
||||
var
|
||||
rx: TRegExpr;
|
||||
i: Integer;
|
||||
begin
|
||||
// Find item in stringlist by passing a regular expression
|
||||
rx := TRegExpr.Create;
|
||||
rx.Expression := Expression;
|
||||
rx.ModifierI := True;
|
||||
Result := -1;
|
||||
for i := 0 to List.Count - 1 do begin
|
||||
if rx.Exec(List[i]) then begin
|
||||
Result := i;
|
||||
break;
|
||||
end;
|
||||
end;
|
||||
FreeAndNil(rx);
|
||||
end;
|
||||
|
||||
|
||||
function FindNode(VT: TVirtualStringTree; idx: Int64; ParentNode: PVirtualNode): PVirtualNode;
|
||||
var
|
||||
Node: PVirtualNode;
|
||||
|
@ -158,7 +158,10 @@ begin
|
||||
SynMemoBody.Text := 'BEGIN'+CRLF+CRLF+'END';
|
||||
if DBObject.Name <> '' then begin
|
||||
// Editing existing routine
|
||||
comboType.ItemIndex := ListIndexByRegExpr(comboType.Items, '^'+FAlterRoutineType+'\b');
|
||||
case Obj.NodeType of
|
||||
lntProcedure: comboType.ItemIndex := 0;
|
||||
lntFunction: comboType.ItemIndex := 1;
|
||||
end;
|
||||
DBObject.Connection.ParseRoutineStructure(Obj.CreateCode, Parameters, Deterministic, Definer, Returns, DataAccess, Security, Comment, Body);
|
||||
comboReturns.Text := Returns;
|
||||
chkDeterministic.Checked := Deterministic;
|
||||
|
Reference in New Issue
Block a user