Hello everybody,
I have a bug (I think in RVGetTextLength function)
If I do that, DELPHI send me Out of limit (-1)
MyRichViewEdit.Clear;
ShowMessage(IntToStr(RVGetTextLength(MyRichViewEdit)));
Have youa solution for that Sergey ?
Thank
JP
Bug in RVGetTextLength function
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Well, yes, calling Format saves the situation for TRichViewEdit (because it adds one empty text item).
But not for TRichView, so it may be really considered as a bug.
Fix: open RVLinear.pas, change RVGetTextLength:
But not for TRichView, so it may be really considered as a bug.
Fix: open RVLinear.pas, change RVGetTextLength:
Code: Select all
function RVGetTextLength(rv: TCustomRichView): Integer;
begin
Result := 0;
if rv.ItemCount=0 then
exit;
RichViewToLinear(rv, rv.RVData, rv.RVData, rv.ItemCount-1,
rv.GetOffsAfterItem(rv.ItemCount-1), Result);
if Result>0 then
dec(Result);
end;