procedure ScanWord(const AText: TcxString; var StartPos: Integer; var TextBrick: TcxTextBrick);
var
I: Integer;
BreakPos: Integer;
Count: Integer;
W: Integer;
EndPos: Integer;
begin
BreakPos := 0;
TextBrick.Text := '';
Count := 0;
EndPos := StartPos;
for I := StartPos to Length(AText) do
begin
Inc(EndPos);
if (AText = #10) then
Break
else
begin
Inc(Count);
if AText = ' ' then
BreakPos := Count;
W := ExTextExtent(@AText[StartPos], Count).CX;
if W > AWidth then
begin
if I > BreakPos then
begin
Dec(Count);
Dec(EndPos);
end;
if BreakPos <> 0 then
begin
Count := BreakPos;
EndPos := StartPos + Count;
end;
Break;
end;
end;
end;
if ByteType(AText, StartPos + Count - 1) = mbLeadByte then
begin
Dec(Count);
Dec(EndPos);
end;
while (Count > 0) and (AText[StartPos + Count] = ' ') do Dec(Count);
begin
with TextBrick do
begin
TextBrick.Text := Copy(AText, StartPos, Count);
if HAlign = haJustify then
begin
{$IFDEF WINDOWS}
BreakCount := 0;
BreakExtra := 1;
for I := 1 to Length(Text) do
if Text = ' ' then Inc(BreakCount);
if BreakCount > 0 then
begin
while AWidth > ExTextExtent(@AText[StartPos], Count).CX do
begin
Inc(BreakExtra);
SetTextJustification(DC, BreakExtra, BreakCount);
end;
end;
{$ELSE}
AdjustWords(TextBrick.Text)
{$ENDIF}
end;
end;
StartPos := EndPos;
end;
end;
在cxSSPainterWrapper.pas中查找上面那个函数,用上面的代码替换