mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-31 11:35:57 +02:00
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:
parent
fe03edd4aa
commit
2c5911c6d3
@ -19,9 +19,6 @@
|
|||||||
</Debugging>
|
</Debugging>
|
||||||
</Linking>
|
</Linking>
|
||||||
<Other>
|
<Other>
|
||||||
<CompilerMessages>
|
|
||||||
<IgnoredMessages idx6058="True"/>
|
|
||||||
</CompilerMessages>
|
|
||||||
<CustomOptions Value="-dCHECK_VALID_SCALING"/>
|
<CustomOptions Value="-dCHECK_VALID_SCALING"/>
|
||||||
<OtherDefines Count="1">
|
<OtherDefines Count="1">
|
||||||
<Define0 Value="CHECK_VALID_SCALING"/>
|
<Define0 Value="CHECK_VALID_SCALING"/>
|
||||||
|
@ -808,7 +808,7 @@ function WordWrap(const AText: String; ADrawer: IChartDrawer;
|
|||||||
AMaxWidth: Integer; ATextFormat: TChartTextFormat): string;
|
AMaxWidth: Integer; ATextFormat: TChartTextFormat): string;
|
||||||
var
|
var
|
||||||
L: TStrings;
|
L: TStrings;
|
||||||
sa: TStringArray;
|
words: TStrings;
|
||||||
line, testline: String;
|
line, testline: String;
|
||||||
s: String;
|
s: String;
|
||||||
w, ws, wspace: Integer;
|
w, ws, wspace: Integer;
|
||||||
@ -820,14 +820,15 @@ begin
|
|||||||
begin
|
begin
|
||||||
wspace := ADrawer.TextExtent(' ').X;
|
wspace := ADrawer.TextExtent(' ').X;
|
||||||
L := TStringList.Create;
|
L := TStringList.Create;
|
||||||
|
words := TStringList.Create;
|
||||||
try
|
try
|
||||||
L.Text := AText;
|
L.Text := AText;
|
||||||
for i := 0 to L.Count-1 do
|
for i := 0 to L.Count-1 do
|
||||||
begin
|
begin
|
||||||
sa := SplitString(L[i], ' ');
|
Split(L[i], words, ' ');
|
||||||
line := '';
|
line := '';
|
||||||
w := 0;
|
w := 0;
|
||||||
for s in sa do
|
for s in words do
|
||||||
begin
|
begin
|
||||||
ws := ADrawer.TextExtent(s).X;
|
ws := ADrawer.TextExtent(s).X;
|
||||||
if w + wspace + ws <= AMaxWidth then
|
if w + wspace + ws <= AMaxWidth then
|
||||||
@ -855,6 +856,7 @@ begin
|
|||||||
Result := Result + LineEnding;
|
Result := Result + LineEnding;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
|
words.Free;
|
||||||
L.Free;
|
L.Free;
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
|
Loading…
Reference in New Issue
Block a user