From: <ah...@us...> - 2009-06-01 14:41:58
|
Revision: 12324 http://jvcl.svn.sourceforge.net/jvcl/?rev=12324&view=rev Author: ahuser Date: 2009-06-01 14:41:54 +0000 (Mon, 01 Jun 2009) Log Message: ----------- Mantis #4784: TJvRichEditStrings.Get() not working under D2009 Modified Paths: -------------- trunk/jvcl/run/JvRichEdit.pas Modified: trunk/jvcl/run/JvRichEdit.pas =================================================================== --- trunk/jvcl/run/JvRichEdit.pas 2009-06-01 11:21:11 UTC (rev 12323) +++ trunk/jvcl/run/JvRichEdit.pas 2009-06-01 14:41:54 UTC (rev 12324) @@ -6082,20 +6082,20 @@ function TJvRichEditStrings.Get(Index: Integer): string; var - Text: array[0..4095] of Char; L: Integer; - W: Word; begin - // (rom) reimplemented as Move - W := SizeOf(Text); - System.Move(W, Text[0], SizeOf(Word)); - L := SendMessage(FRichEdit.Handle, EM_GETLINE, Index, Longint(@Text)); - if (Text[L - 2] = Cr) and (Text[L - 1] = Lf) then - Dec(L, 2) - else - if (RichEditVersion >= 2) and (Text[L - 1] = Cr) then - Dec(L); - SetString(Result, Text, L); + L := FRichEdit.GetLineLength(Index); + SetLength(Result, L); + if L > 0 then + begin + PWord(Pointer(Result))^ := L; + L := SendMessage(FRichEdit.Handle, EM_GETLINE, Index, LPARAM(Pointer(Result))); + if (Result[L - 2] = Cr) and (Result[L - 1] = Lf) then + SetLength(Result, L - 2) + else + if (RichEditVersion >= 2) and (Result[L - 1] = Cr) then + SetLength(Result, L - 1); + end; end; function TJvRichEditStrings.GetCount: Integer; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |