Permalink
Browse files

Don't copy values of virtual columns when duplicating a row. Closes #53

  • Loading branch information...
ansgarbecker committed Dec 22, 2017
1 parent c2594e4 commit c5f655753edf449523b40801d52da271c212c867
Showing with 4 additions and 0 deletions.
  1. +4 −0 source/main.pas
View
@@ -4533,6 +4533,7 @@ procedure TMainForm.actDataInsertExecute(Sender: TObject);
i: Integer;
Value: String;
IsNull, AllowNewNode: Boolean;
TableCol: TTableColumn;
begin
Grid := ActiveGrid;
Results := GridResult(Grid);
@@ -4558,6 +4559,9 @@ procedure TMainForm.actDataInsertExecute(Sender: TObject);
continue; // Ignore invisible key column
if Results.ColIsPrimaryKeyPart(i) then
continue; // Empty value for primary key column
TableCol := Results.ColAttributes(i);
if (TableCol <> nil) and (not TableCol.Virtuality.IsEmpty) then
continue; // Don't copy virtual column value
Results.RecNo := DupeNum^;
Value := Results.Col(i);
IsNull := Results.IsNull(i);

0 comments on commit c5f6557

Please sign in to comment.