mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2026-03-13 09:24:25 +08:00
Try a blank default date/time value for grid editing. Hopefully fixes issue #2708 finally.
This commit is contained in:
@@ -78,7 +78,6 @@ type
|
||||
FModifyOffset: Integer;
|
||||
FTimerCalls: Integer;
|
||||
FUpDown: TUpDown;
|
||||
FDefaultDateTime: String;
|
||||
procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure DoKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure UpDownChangingEx(Sender: TObject; var AllowChange: Boolean; NewValue: SmallInt; Direction: TUpDownDirection);
|
||||
@@ -93,7 +92,6 @@ type
|
||||
function EndEdit: Boolean; override;
|
||||
function PrepareEdit(Tree: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex): Boolean; override;
|
||||
procedure SetBounds(R: TRect); override;
|
||||
property DefaultDateTime: String read FDefaultDateTime write FDefaultDateTime;
|
||||
end;
|
||||
|
||||
TEnumEditorLink = class(TBaseGridEditorLink)
|
||||
@@ -521,8 +519,6 @@ begin
|
||||
FTimer.Interval := 50;
|
||||
FTimer.OnTimer := DoOnTimer;
|
||||
FTimer.Enabled := False;
|
||||
|
||||
FDefaultDateTime := '';
|
||||
end;
|
||||
|
||||
|
||||
@@ -574,14 +570,7 @@ begin
|
||||
end;
|
||||
dtYear: FMaskEdit.EditMask := '0000;1; ';
|
||||
end;
|
||||
if FCellText = '' then begin
|
||||
FMaskEdit.Text := FDefaultDateTime;
|
||||
case DataType of
|
||||
dtDate: FMaskEdit.Text := Copy(FMaskEdit.Text, 1, 10);
|
||||
dtTime: FMaskEdit.Text := Copy(FMaskEdit.Text, 12, 8);
|
||||
end;
|
||||
end else
|
||||
FMaskEdit.Text := FCellText;
|
||||
FMaskEdit.Text := FCellText;
|
||||
FModified := False;
|
||||
FMaskEdit.Font.Assign(FCellFont);
|
||||
FPanel.Color := FCellBackground;
|
||||
|
||||
@@ -7717,9 +7717,6 @@ begin
|
||||
end else if (TypeCat = dtcTemporal) and prefEnableDatetimeEditor then begin
|
||||
DateTimeEditor := TDateTimeEditorLink.Create(VT);
|
||||
DateTimeEditor.DataType := Results.DataType(Column).Index;
|
||||
// Ensure date/time editor starts with a non-empty text value
|
||||
if Results.Col(Column) = '' then
|
||||
DateTimeEditor.DefaultDateTime := Conn.GetVar('SELECT NOW()');
|
||||
EditLink := DateTimeEditor;
|
||||
end else if (Results.DataType(Column).Index = dtSet) and prefEnableSetEditor then begin
|
||||
SetEditor := TSetEditorLink.Create(VT);
|
||||
|
||||
Reference in New Issue
Block a user