From: Maël Hörz <ma...@us...> - 2009-03-17 18:12:20
|
Update of /cvsroot/synedit/SynEdit/Source In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30967 Modified Files: Tag: Unicode_2004_08_31 SynEditTextBuffer.pas Log Message: Fix: Delphi 2009 adds an additional linebreak to the Text-property compared to older Delphi versions (Delphi 7) Index: SynEditTextBuffer.pas =================================================================== RCS file: /cvsroot/synedit/SynEdit/Source/SynEditTextBuffer.pas,v retrieving revision 1.63.2.13 retrieving revision 1.63.2.14 diff -u -d -r1.63.2.13 -r1.63.2.14 --- SynEditTextBuffer.pas 14 Sep 2008 16:24:59 -0000 1.63.2.13 +++ SynEditTextBuffer.pas 17 Mar 2009 18:12:14 -0000 1.63.2.14 @@ -605,12 +605,26 @@ SLineBreak: UnicodeString; begin if not FStreaming then - Result := inherited GetTextStr + begin + Result := inherited GetTextStr; +{$IFDEF UNICODE} + if copy(Result, Length(Result) - Length(LineBreak) + 1, Length(LineBreak)) = + LineBreak then + begin + SetLength(Result, Length(Result) - Length(LineBreak)); + end; +{$ENDIF} + end else begin {$IFDEF UNICODE} SLineBreak := LineBreak; Result := inherited GetTextStr; + if copy(Result, Length(Result) - Length(LineBreak) + 1, Length(LineBreak)) = + LineBreak then + begin + SetLength(Result, Length(Result) - Length(LineBreak)); + end; {$ELSE} case FileFormat of sffDos: |