From 1ab975b0d50be211637149e5660c83e6205fc3ac Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Wed, 12 May 2010 18:33:21 +0000 Subject: [PATCH] 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. --- source/main.pas | 2 ++ source/mysql_connection.pas | 5 +---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/main.pas b/source/main.pas index f06f64ae..63362c12 100644 --- a/source/main.pas +++ b/source/main.pas @@ -6797,6 +6797,8 @@ begin RowNum := Sender.GetNodeData(Node); Results.RecNo := RowNum^; try + if Results.DataType(Column).Category in [dtcInteger, dtcReal] then + NewText := UnformatNumber(NewText); Results.SetCol(Column, NewText, False); except on E:EDatabaseError do MessageDlg(E.Message, mtError, [mbOK], 0); diff --git a/source/mysql_connection.pas b/source/mysql_connection.pas index 9036144b..2d0bb471 100644 --- a/source/mysql_connection.pas +++ b/source/mysql_connection.pas @@ -1932,11 +1932,8 @@ begin FCurrentUpdateRow[Column].NewIsNull := Null; if Null then FCurrentUpdateRow[Column].NewText := '' - else begin + else 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].NewIsNull <> FCurrentUpdateRow[Column].OldIsNull); end;