Move responsibility for well formed floats and integers from TMySQLQuery.SetCol() to caller, so new values don't get touched at all, and to avoid double-unformatted numbers in "Duplicate row" feature. Fixes issue #1936.

This commit is contained in:
Ansgar Becker
2010-05-12 18:33:21 +00:00
parent dd40361d81
commit 1ab975b0d5
2 changed files with 3 additions and 4 deletions

View File

@ -6797,6 +6797,8 @@ begin
RowNum := Sender.GetNodeData(Node); RowNum := Sender.GetNodeData(Node);
Results.RecNo := RowNum^; Results.RecNo := RowNum^;
try try
if Results.DataType(Column).Category in [dtcInteger, dtcReal] then
NewText := UnformatNumber(NewText);
Results.SetCol(Column, NewText, False); Results.SetCol(Column, NewText, False);
except except
on E:EDatabaseError do MessageDlg(E.Message, mtError, [mbOK], 0); on E:EDatabaseError do MessageDlg(E.Message, mtError, [mbOK], 0);

View File

@ -1932,11 +1932,8 @@ begin
FCurrentUpdateRow[Column].NewIsNull := Null; FCurrentUpdateRow[Column].NewIsNull := Null;
if Null then if Null then
FCurrentUpdateRow[Column].NewText := '' FCurrentUpdateRow[Column].NewText := ''
else begin else
FCurrentUpdateRow[Column].NewText := NewText; FCurrentUpdateRow[Column].NewText := NewText;
if DataType(Column).Category in [dtcInteger, dtcReal] then
FCurrentUpdateRow[Column].NewText := UnformatNumber(FCurrentUpdateRow[Column].NewText);
end;
FCurrentUpdateRow[Column].Modified := (FCurrentUpdateRow[Column].NewText <> FCurrentUpdateRow[Column].OldText) or FCurrentUpdateRow[Column].Modified := (FCurrentUpdateRow[Column].NewText <> FCurrentUpdateRow[Column].OldText) or
(FCurrentUpdateRow[Column].NewIsNull <> FCurrentUpdateRow[Column].OldIsNull); (FCurrentUpdateRow[Column].NewIsNull <> FCurrentUpdateRow[Column].OldIsNull);
end; end;