mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Restrict HTML formatter for SQL INSERT/REPLACE output in grid export dialog to 100kb, as SynEdit is just too slow when exporting larger strings. Fixes issue #2903.
This commit is contained in:
@ -689,17 +689,20 @@ begin
|
|||||||
S.WriteString(tmp);
|
S.WriteString(tmp);
|
||||||
|
|
||||||
if radioOutputCopyToClipboard.Checked then begin
|
if radioOutputCopyToClipboard.Checked then begin
|
||||||
case ExportFormat of
|
// SynEdit's exporter is slow on large strings, see issue #2903
|
||||||
efSQLInsert, efSQLReplace: begin
|
if S.Size < 100*SIZE_KB then begin
|
||||||
Exporter := TSynExporterHTML.Create(Self);
|
case ExportFormat of
|
||||||
Exporter.Highlighter := MainForm.SynSQLSyn1;
|
efSQLInsert, efSQLReplace: begin
|
||||||
Exporter.ExportAll(Explode(CRLF, S.DataString));
|
Exporter := TSynExporterHTML.Create(Self);
|
||||||
HTML := TMemoryStream.Create;
|
Exporter.Highlighter := MainForm.SynSQLSyn1;
|
||||||
Exporter.SaveToStream(HTML);
|
Exporter.ExportAll(Explode(CRLF, S.DataString));
|
||||||
Exporter.Free;
|
HTML := TMemoryStream.Create;
|
||||||
|
Exporter.SaveToStream(HTML);
|
||||||
|
Exporter.Free;
|
||||||
|
end;
|
||||||
|
efHTML: HTML := S;
|
||||||
|
else HTML := nil;
|
||||||
end;
|
end;
|
||||||
efHTML: HTML := S;
|
|
||||||
else HTML := nil;
|
|
||||||
end;
|
end;
|
||||||
StreamToClipboard(S, HTML, (ExportFormat=efHTML) and (HTML <> nil));
|
StreamToClipboard(S, HTML, (ExportFormat=efHTML) and (HTML <> nil));
|
||||||
end else begin
|
end else begin
|
||||||
|
Reference in New Issue
Block a user