Do not write "NULL" string in grid export formats other than SQL INSERTs/REPLACEs. Fixes issue #2733.

This commit is contained in:
Ansgar Becker
2012-02-28 22:26:14 +00:00
parent 867d656f0b
commit 4ef984b52d

View File

@ -577,9 +577,6 @@ begin
case ExportFormat of
efHTML: begin
// Handle nulls.
if GridData.IsNull(Col) then
Data := TEXT_NULL;
// Escape HTML control characters in data.
Data := htmlentities(Data);
tmp := tmp + ' <td class="col' + IntToStr(Col) + '">' + Data + '</td>' + CRLF;
@ -588,12 +585,6 @@ begin
efExcel, efCSV, efLaTeX, efWiki: begin
// Escape encloser characters inside data per de-facto CSV.
Data := StringReplace(Data, Encloser, Encloser+Encloser, [rfReplaceAll]);
// Special handling for NULL (MySQL-ism, not de-facto CSV: unquote value)
if GridData.IsNull(Col) then begin
Data := 'NULL';
if ExportFormat = efWiki then
Data := '_'+Data+'_';
end else
Data := Encloser + Data + Encloser;
tmp := tmp + Data + Separator;
end;