hedgewars/uChat.pas
changeset 10837 1b7a4d3111ea
parent 10836 0b415bc2e0eb
child 10839 aa0ceb47da1d
--- 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