From de24172d78b562811026bb5aece31428efe2e91a Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 7 Feb 2011 15:42:05 +0200 Subject: Memo: SetText now assigns incoming text as is to the internal stringlist. No more manual handling of LineEnding characters etc, because StringList does that already, and our custom handling causes blank lines to disappear in the memo. Not what we want. --- src/gui/fpg_memo.pas | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas index 8863ca67..0e0d0f83 100644 --- a/src/gui/fpg_memo.pas +++ b/src/gui/fpg_memo.pas @@ -1680,24 +1680,26 @@ begin FLines.Clear; s := ''; n := 1; - while n <= UTF8Length(AValue) do - begin - c := UTF8Copy(AValue, n, 1); - if (c[1] = #13) or (c[1] = #10) then - begin - FLines.Add(s); - s := ''; - c := UTF8Copy(AValue, n + 1, 1); - if c[1] = #10 then - Inc(n); - end - else - s := s + c; - Inc(n); - end; - if s <> '' then - FLines.Add(s); + FLines.Text := AValue; + //while n <= UTF8Length(AValue) do + //begin + // c := UTF8Copy(AValue, n, 1); + // if (c[1] = #13) or (c[1] = #10) then + // begin + // FLines.Add(s); + // s := ''; + // c := UTF8Copy(AValue, n + 1, 1); + // if c[1] = #10 then + // Inc(n); + // end + // else + // s := s + c; + // Inc(n); + //end; + // + //if s <> '' then + // FLines.Add(s); FDrawOffset := 0; FCursorPos := 0; -- cgit v1.2.3-70-g09d2