TAChart: Fix compilation with FPC 3.0.4, issue #38623. Undo part of r64450 #47499875e6 which does not compile with 3.0.4 either.

git-svn-id: trunk@64811 -
This commit is contained in:
wp 2021-03-14 21:30:50 +00:00
parent fe03edd4aa
commit 2c5911c6d3
2 changed files with 5 additions and 6 deletions

View File

@ -19,9 +19,6 @@
</Debugging>
</Linking>
<Other>
<CompilerMessages>
<IgnoredMessages idx6058="True"/>
</CompilerMessages>
<CustomOptions Value="-dCHECK_VALID_SCALING"/>
<OtherDefines Count="1">
<Define0 Value="CHECK_VALID_SCALING"/>

View File

@ -808,7 +808,7 @@ function WordWrap(const AText: String; ADrawer: IChartDrawer;
AMaxWidth: Integer; ATextFormat: TChartTextFormat): string;
var
L: TStrings;
sa: TStringArray;
words: TStrings;
line, testline: String;
s: String;
w, ws, wspace: Integer;
@ -820,14 +820,15 @@ begin
begin
wspace := ADrawer.TextExtent(' ').X;
L := TStringList.Create;
words := TStringList.Create;
try
L.Text := AText;
for i := 0 to L.Count-1 do
begin
sa := SplitString(L[i], ' ');
Split(L[i], words, ' ');
line := '';
w := 0;
for s in sa do
for s in words do
begin
ws := ADrawer.TextExtent(s).X;
if w + wspace + ws <= AMaxWidth then
@ -855,6 +856,7 @@ begin
Result := Result + LineEnding;
end;
finally
words.Free;
L.Free;
end;
end else