Solving problem List Insex Out of bound
Posted: Thu Jan 31, 2008 8:34 pm
Sorry for my english
Until debugging source code we found next :
In unit SclRView in procedure TSRichViewEdit.DrawComponents
was written:
for ItemNo := StartItemNo to EndItemNo do
case RVData.GetItemStyle(ItemNo) of
rvsComponent :
begin
..........
This cause errors in such cases:
1. Paste text from Clipboard and then Undo
2. In some cases type BackSpace
3. And using function InsertText
In my opinion the problem is that qty. items in RVData does not equal EndItemNo
This is my solving:
begin
RVData.UpdateItemsPaletteInfo; // update RVData items
for ItemNo := StartItemNo to RVData.ItemCount - 1 do
// for ItemNo := StartItemNo to EndItemNo do
case RVData.GetItemStyle(ItemNo) of
rvsComponent :
begin
......
In our project it works. But if we have made mistake tell us.
Thanks
Until debugging source code we found next :
In unit SclRView in procedure TSRichViewEdit.DrawComponents
was written:
for ItemNo := StartItemNo to EndItemNo do
case RVData.GetItemStyle(ItemNo) of
rvsComponent :
begin
..........
This cause errors in such cases:
1. Paste text from Clipboard and then Undo
2. In some cases type BackSpace
3. And using function InsertText
In my opinion the problem is that qty. items in RVData does not equal EndItemNo
This is my solving:
begin
RVData.UpdateItemsPaletteInfo; // update RVData items
for ItemNo := StartItemNo to RVData.ItemCount - 1 do
// for ItemNo := StartItemNo to EndItemNo do
case RVData.GetItemStyle(ItemNo) of
rvsComponent :
begin
......
In our project it works. But if we have made mistake tell us.
Thanks