# HG changeset patch # User sheepluva # Date 1425218671 -3600 # Node ID 1b7a4d3111ea07c92d054ffa27f27ab8f712bdc6 # Parent 0b415bc2e0eb4f58bb48ccd153af726920239100 pas2c does not like setlength called with a shortstring apparently diff -r 0b415bc2e0eb -r 1b7a4d3111ea hedgewars/uChat.pas --- a/hedgewars/uChat.pas Sun Mar 01 04:15:11 2015 +0100 +++ b/hedgewars/uChat.pas Sun Mar 01 15:04:31 2015 +0100 @@ -113,7 +113,8 @@ font:= CheckCJKFont(ansistring(str), fnt16); // get only substring before cursor to determine length - SetLength(str, Length(InputLinePrefix) + cursorPos); + // SetLength(str, Length(InputLinePrefix) + cursorPos); // makes pas2c unhappy + str[0]:= char(Length(InputLinePrefix) + cursorPos); // get render size of text TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(str), @coff, nil); @@ -124,7 +125,8 @@ begin if selectedPos > cursorPos then str:= InputLinePrefix + InputStr.s; - SetLength(str, Length(InputLinePrefix) + selectedPos); + // SetLength(str, Length(InputLinePrefix) + selectedPos); // makes pas2c unhappy + str[0]:= char(Length(InputLinePrefix) + selectedPos); TTF_SizeUTF8(Fontz[font].Handle, Str2PChar(str), @soff, nil); selectionDx:= soff - coff; end