From ff25e466d6a36a79dc236f07701ed9589795cda6 Mon Sep 17 00:00:00 2001 From: "rosenfield.albert" Date: Fri, 5 Sep 2008 12:28:00 +0000 Subject: [PATCH] * Bugfix: fix issue #717. * Rely on IsFloat instead of a more obscure check to determine float values. --- source/helpers.pas | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/helpers.pas b/source/helpers.pas index 234953f3..75a3bf10 100644 --- a/source/helpers.pas +++ b/source/helpers.pas @@ -920,7 +920,7 @@ begin // Remove 0x. if GridData.Columns[i].IsBinary then Delete(Data, 1, 2); // Unformat float values - if Grid.Header.Columns[i].Alignment = taRightJustify then Data := FloatStr(Data); + if GridData.Columns[i].IsFloat then Data := FloatStr(Data); // Escape encloser characters inside data per de-facto CSV. Data := WideStringReplace(Data, Encloser, Encloser + Encloser, [rfReplaceAll]); // Special handling for NULL (MySQL-ism, not de-facto CSV: unquote value) @@ -971,18 +971,19 @@ begin Continue; // Print cell start tag. tmp := tmp + #9#9'<' + Grid.Header.Columns[i].Text; + // Ensure basic data is loaded. + Mainform.Childwin.EnsureDataLoaded(Grid, Node); if GridData.Rows[Node.Index].Cells[i].IsNull then tmp := tmp + ' isnull="true" />' + CRLF else begin if GridData.Columns[i].IsBinary then tmp := tmp + ' format="hex"'; tmp := tmp + '>'; - // Ensure basic data is loaded and load remainder of large fields. - Mainform.Childwin.EnsureDataLoaded(Grid, Node); + // Load remainder of large fields. Mainform.Childwin.EnsureFullWidth(Grid, i, Node); Data := Grid.Text[Node, i]; // Remove 0x. if GridData.Columns[i].IsBinary then Delete(Data, 1, 2); // Unformat float values - if Grid.Header.Columns[i].Alignment = taRightJustify then Data := FloatStr(Data); + if GridData.Columns[i].IsFloat then Data := FloatStr(Data); // Escape XML control characters in data. Data := htmlentities(Data); // Add data and cell end tag.