mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Columns of selected datagrid object can also come from a view, so ParseTableStructure is not sufficient in both data sorting and column selection forms. Instead, just use mainform's lists which are exactly what we need. Fixes issue #1611.
This commit is contained in:
@ -35,7 +35,6 @@ type
|
||||
procedure Modified;
|
||||
public
|
||||
{ Public declarations }
|
||||
FColumns: TTableColumnList;
|
||||
end;
|
||||
|
||||
|
||||
@ -55,7 +54,6 @@ procedure TDataSortingForm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
InheritFont(Font);
|
||||
ColumnNames := TStringList.Create;
|
||||
FColumns := TTableColumnList.Create;
|
||||
end;
|
||||
|
||||
|
||||
@ -65,16 +63,11 @@ end;
|
||||
procedure TDataSortingForm.FormShow(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
KeysDummy: TTableKeyList;
|
||||
ForeignKeysDummy: TForeignKeyList;
|
||||
begin
|
||||
// Take column names from listColumns and add here
|
||||
KeysDummy := nil;
|
||||
ForeignKeysDummy := nil;
|
||||
ParseTableStructure(Mainform.SelectedTableCreateStatement, FColumns, KeysDummy, ForeignKeysDummy);
|
||||
ColumnNames.Clear;
|
||||
for i:=0 to FColumns.Count-1 do
|
||||
ColumnNames.Add(FColumns[i].Name);
|
||||
for i:=0 to Mainform.SelectedTableColumns.Count-1 do
|
||||
ColumnNames.Add(Mainform.SelectedTableColumns[i].Name);
|
||||
|
||||
OrderColumns := Mainform.FDataGridSort;
|
||||
OldOrderClause := ComposeOrderClause(OrderColumns);
|
||||
|
Reference in New Issue
Block a user