Hi Sergey,
I can consistently reproduce this error in RichViewEdit 1.9.15.1, Delphi 5 if you:
type some text
insert a table
in the LAST cell of the table insert an animated gif image (using Anders component)
type some text under the table
Then, when you press backspace to delete the text, when you reach the beginning of the line and go to the previous line, the exception occurs.
I've emailed you an attachment containing a cut-down sample application that reproduces this error. Just right click the RVE and choose 'Import file' and import the attached .RVF file, then just press backspace a few times from the bottom to get the error.
I could not reproduce this problem in RichViewActions and wonder if it is related to use of unicode in my app?
Thanks for any suggestions
Index out of bounds exception
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Thanks Sergey,
Yes in the cut-down app I emailed you, the exception does seem to be captured. However, I discovered this problem when in my main app the problem occured and in red letters in the top left corner of the RVE was the message 'Error: List index out of bounds (7)'. So I think in some circumstances it was not captured so well . I have emailed you two screen shots 'before' and 'after' displaying this error.
Do you think your fix will have captured this more serious one as well? Which version number will this be released in?
Yes in the cut-down app I emailed you, the exception does seem to be captured. However, I discovered this problem when in my main app the problem occured and in red letters in the top left corner of the RVE was the message 'Error: List index out of bounds (7)'. So I think in some circumstances it was not captured so well . I have emailed you two screen shots 'before' and 'after' displaying this error.
Do you think your fix will have captured this more serious one as well? Which version number will this be released in?
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I can explain where you need to modify.
Change 1, CRVFData.pas.
Beginning of DrawItem2Item must be:
Change 2, RVTable.pas, change TRVTableItemInfo.CompletelySelected
Change 1, CRVFData.pas.
Beginning of DrawItem2Item must be:
Code: Select all
procedure TCustomRVFormattedData.DrawItem2Item(DrawItemNo, DrawItemOffs: Integer;
var ItemNo, ItemOffs: Integer);
var dli: TRVDrawLineInfo;
begin
ItemNo := -1;
if (DrawItemNo = -1) or (DrawItemNo>=DrawItems.Count) then exit;
Code: Select all
function TRVTableItemInfo.CompletelySelected: Boolean;
var SN,EN,SO,EO,No: Integer;
begin
Result := Rows.FMainRVData is TCustomRVFormattedData;
if not Result then
exit;
if rvstCompletelySelected in Rows.FMainRVData.State then
exit;
TCustomRVFormattedData(Rows.FMainRVData).GetSelectionBounds(SN,SO,EN,EO,True);
Result := (SN>=0) and (EN>=0);
if not Result then
exit;
No := GetMyItemNo;
Result := ((No>SN) or ((No=SN) and (SO=0))) and
((No<EN) or ((No=EN) and (EO=1)));
end;