SaveModifications() should process all virtual rows, but ignore just inserted ones, so we can call InsertRow and then SaveModifications for yet modified rows. Fixes issue #1918.

This commit is contained in:
Ansgar Becker
2010-05-08 08:14:35 +00:00
parent 18c08dc4d1
commit ede2fab6f1

View File

@ -2049,16 +2049,7 @@ begin
end; end;
end else end else
Connection.Query('UPDATE '+QuotedDbAndTableName+' SET '+sqlUpdate+' WHERE '+GetWhereClause); Connection.Query('UPDATE '+QuotedDbAndTableName+' SET '+sqlUpdate+' WHERE '+GetWhereClause);
// TODO: Reload real row data from server if keys allow that??? // Reset modification flags
except
on E:EDatabaseError do begin
Result := False;
MessageDlg(E.Message, mtError, [mbOK], 0);
end;
end;
// Reset modification flags
if Result then begin
for i:=0 to ColumnCount-1 do begin for i:=0 to ColumnCount-1 do begin
Cell := Row[i]; Cell := Row[i];
Cell.OldText := Cell.NewText; Cell.OldText := Cell.NewText;
@ -2066,6 +2057,12 @@ begin
Cell.Modified := False; Cell.Modified := False;
end; end;
Row.Inserted := False; Row.Inserted := False;
// TODO: Reload real row data from server if keys allow that???
except
on E:EDatabaseError do begin
Result := False;
MessageDlg(E.Message, mtError, [mbOK], 0);
end;
end; end;
end; end;