mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Outsource new line replacements into new StripNewLines() function
This commit is contained in:
@ -334,6 +334,7 @@ type
|
|||||||
function IsFloat(Str: String): Boolean;
|
function IsFloat(Str: String): Boolean;
|
||||||
function ScanLineBreaks(Text: String): TLineBreaks;
|
function ScanLineBreaks(Text: String): TLineBreaks;
|
||||||
function fixNewlines(txt: String): String;
|
function fixNewlines(txt: String): String;
|
||||||
|
procedure StripNewLines(var txt: String; Replacement: String=' ');
|
||||||
function GetLineBreak(LineBreakIndex: TLineBreaks): String;
|
function GetLineBreak(LineBreakIndex: TLineBreaks): String;
|
||||||
procedure RemoveNullChars(var Text: String; var HasNulls: Boolean);
|
procedure RemoveNullChars(var Text: String; var HasNulls: Boolean);
|
||||||
function GetShellFolder(FolderId: TGUID): String;
|
function GetShellFolder(FolderId: TGUID): String;
|
||||||
@ -828,6 +829,12 @@ begin
|
|||||||
result := txt;
|
result := txt;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure StripNewLines(var txt: String; Replacement: String=' ');
|
||||||
|
begin
|
||||||
|
txt := StringReplace(txt, #13#10, Replacement, [rfReplaceAll]);
|
||||||
|
txt := StringReplace(txt, #13, Replacement, [rfReplaceAll]);
|
||||||
|
txt := StringReplace(txt, #10, Replacement, [rfReplaceAll]);
|
||||||
|
end;
|
||||||
|
|
||||||
function GetLineBreak(LineBreakIndex: TLineBreaks): String;
|
function GetLineBreak(LineBreakIndex: TLineBreaks): String;
|
||||||
begin
|
begin
|
||||||
|
@ -948,9 +948,7 @@ begin
|
|||||||
|
|
||||||
// Remove linebreaks, see #474
|
// Remove linebreaks, see #474
|
||||||
if chkRemoveLinebreaks.Checked then begin
|
if chkRemoveLinebreaks.Checked then begin
|
||||||
Data := StringReplace(Data, #13#10, ' ', [rfReplaceAll]);
|
StripNewLines(Data);
|
||||||
Data := StringReplace(Data, #13, ' ', [rfReplaceAll]);
|
|
||||||
Data := StringReplace(Data, #10, ' ', [rfReplaceAll]);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
case ExportFormat of
|
case ExportFormat of
|
||||||
|
Reference in New Issue
Block a user