Solving problem List Insex Out of bound

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
liabach
Posts: 4
Joined: Mon Jul 16, 2007 11:35 am

Solving problem List Insex Out of bound

Post by liabach »

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
proxy3d
ScaleRichView Developer
Posts: 307
Joined: Mon Aug 07, 2006 9:37 am

Post by proxy3d »

In this code there is no mistake. At formatting the document, the call repaint is a mistake. The new release is now ready, is fast we it we shall lay out.
Post Reply