diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-02-07 15:42:05 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-02-07 15:42:05 +0200 |
commit | de24172d78b562811026bb5aece31428efe2e91a (patch) | |
tree | 37506baa78164adb2c28bd86070c9d3a7e306704 | |
parent | fa8acc2b58592ea1382ae8a986c3c159e53229ce (diff) | |
download | fpGUI-de24172d78b562811026bb5aece31428efe2e91a.tar.xz |
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.
-rw-r--r-- | src/gui/fpg_memo.pas | 36 |
1 files 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; |