richmemo: cleanup warnings

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6525 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2018-06-25 02:11:10 +00:00
parent c6b5ea4fa8
commit b66e16bb76
2 changed files with 17 additions and 9 deletions

View File

@ -209,11 +209,13 @@ function TRichEditParaAttributes.GetTab(Index: Byte): Integer;
var
m : TCustomRichMemo;
stop : TTabStopList;
idx : integer;
begin
idx:=Index;
m:=TCustomRichMemo(TObject(Self));
m.GetParaTabs(m.SelStart, stop);
if (Index<0) or (Index>=stop.Count) then Result:=0
else Result:=round(stop.Tabs[Index].Offset);
if (idx<0) or (idx>=stop.Count) then Result:=0
else Result:=round(stop.Tabs[idx].Offset);
end;
function TRichEditParaAttributes.GetTabCount: Integer;
@ -263,13 +265,15 @@ procedure TRichEditParaAttributes.SetTab(Index: Byte; AValue: Integer);
var
m : TCustomRichMemo;
stop : TTabStopList;
idx : integer;
begin
idx:=Index;
m:=TCustomRichMemo(TObject(Self));
m.GetParaTabs(m.SelStart, stop);
if (Index<0) or (Index>=stop.Count) then
if (idx<0) or (idx>=stop.Count) then
Exit
else begin
stop.Tabs[index].Offset:=AValue;
stop.Tabs[idx].Offset:=AValue;
m.SetParaTabs(m.SelStart, m.SelLength, stop);
end;
end;