Page 1 of 2

List index out of bounds when in table

Posted: Tue Jan 24, 2006 7:03 am
by Marsianin
When cursor cet in the table and "nonprinted characters" button pressed (RVActions) "List Index out of bounds (18)" appears with infinite loop.
So only Ctrl+Alt+Del helps :?

Posted: Tue Jan 24, 2006 11:40 am
by Sergey Tkachenko
I cannot reproduce this problem.
Which version of TRichView do you use?

Posted: Wed Jan 25, 2006 6:41 am
by Marsianin
The last one I think - 1.9.8
I'll try to reproduce it one more time...

Posted: Wed Jan 25, 2006 3:34 pm
by Sergey Tkachenko
v1.9.8 had a bug appeared in Delphi 2005 (other versions of Delphi and C++Builder unaffected). This bug is fixed in newer versions.

Posted: Mon Apr 10, 2006 7:33 am
by Marsianin
The problem still remains.
Delphi 7 SP1, TRichView 1.9.24, TRichViewActions 1.51.1

Clear TRichViewEdit. Inserting empty table for example 3x3.
Set cursor to the center cell, pressed Toolbak2k button with assigned rvActionShowSpecialCharacters.

Got EListError: List index out of bounds (0), every time. Zero value can be different...depends of table...or text in table.

Posted: Mon Apr 10, 2006 9:42 am
by Sergey Tkachenko
I still cannot reproduce this problem.
I tried both the latest version of RV/RichViewActions and the ActionTest demo compiled with v1.9.8 (you can download exe from the site)

Posted: Mon Apr 10, 2006 8:53 pm
by Marsianin
Seems it happens only with some non-default options. I'm not sure.
Here is my options for TRichViewEdit hope this helps:

Code: Select all

object RichViewEdit1: TRichViewEdit
      Left = 0
      Top = 23
      Width = 348
      Height = 202
      AcceptDragDropFormats = [rvddRVF, rvddRTF, rvddText, rvddUnicodeText, rvddBitmap, rvddMetafile, rvddURL, rvddFiles]
      ReadOnly = False
      OnCaretMove = RichViewEdit1CaretMove
      OnCurParaStyleChanged = RichViewEdit1CurParaStyleChanged
      OnCurTextStyleChanged = RichViewEdit1CurTextStyleChanged
      OnParaStyleConversion = RichViewEdit1ParaStyleConversion
      OnPaste = RichViewEdit1Paste
      OnStyleConversion = RichViewEdit1StyleConversion
      Align = alClient
      PopupMenu = TBXPopupMenu1
      TabOrder = 0
      Visible = False
      OnKeyDown = RichViewEdit1KeyDown
      OnKeyPress = RichViewEdit1KeyPress
      DoInPaletteMode = rvpaCreateCopies
      Options = [rvoAllowSelection, rvoScrollToEnd, rvoTagsArePChars, rvoAutoCopyText, rvoAutoCopyRVF, rvoAutoCopyImage, rvoAutoCopyRTF, rvoFormatInvalidate, rvoDblClickSelectsWord, rvoRClickDeselects]
      RTFReadProperties.TextStyleMode = rvrsAddIfNeeded
      RTFReadProperties.ParaStyleMode = rvrsAddIfNeeded
      RTFReadProperties.UseHypertextStyles = True
      RVFOptions = [rvfoSavePicturesBody, rvfoSaveControlsBody, rvfoIgnoreUnknownPicFmt, rvfoIgnoreUnknownCtrls, rvfoSaveBinary, rvfoSaveBack, rvfoLoadBack, rvfoSaveTextStyles, rvfoSaveParaStyles, rvfoSaveLayout, rvfoLoadLayout, rvfoSaveDocProperties, rvfoLoadDocProperties]
      Style = RVStyle1
      OnJump = RichViewEdit1Jump
      OnReadHyperlink = RichViewEdit1ReadHyperlink
      OnWriteHyperlink = RichViewEdit1WriteHyperlink
    end

Posted: Mon Apr 10, 2006 9:16 pm
by Sergey Tkachenko
Probably, the error is because of code in some of these events:
OnCaretMove, OnCurTextStyleChanged, OnCurParaStyleChanged.

Posted: Fri Apr 21, 2006 4:59 am
by softtouch
I am also getting more and more list index out of bound when working with tables.

ControlClass: TRVTableInplaceEdit

People just insert a hyperling in a selected text, which is inside a table and they get list index out of bound (7)

Any idea?

Posted: Fri Apr 21, 2006 6:38 am
by Sergey Tkachenko
The most probably, it's because of code in events.
If you can create a simple project reproducing this problem, please send it to me.

Posted: Wed Apr 26, 2006 5:46 pm
by Marsianin
I found the place of this problem. It appears here (only when cursor set inside table) in GetLineNo function:

Code: Select all

procedure TMainForm.RichViewEdit1CaretMove(Sender: TObject);
var line,linescount,col:Integer;
begin
  RichViewEdit1.GetCurrentLineCol(line,col);
  With RichViewEdit1 do
    linescount:=GetLineNo(ItemCount-1,GetOffsAfterItem(ItemCount-1));
end;

Posted: Thu Apr 27, 2006 6:25 pm
by Sergey Tkachenko
And which of these functions generates error?

Posted: Thu Apr 27, 2006 7:04 pm
by Marsianin
As I said above - linescount:=GetLineNo(ItemCount-1,GetOffsAfterItem(ItemCount-1))

Posted: Mon May 01, 2006 6:20 pm
by Marsianin
So is there any suggestions ?

May be I can check if OnCaretMove fired with pressing "nonprinted characters" button ?
And I'm wondering why OnCaretMove fires with pressing that button ?

Posted: Mon May 01, 2006 6:32 pm
by Sergey Tkachenko
Will be fixed in the next update