List index out of bounds when in table

General TRichView support forum. Please post your questions here
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

List index out of bounds when in table

Post 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 :?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I cannot reproduce this problem.
Which version of TRichView do you use?
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post by Marsianin »

The last one I think - 1.9.8
I'll try to reproduce it one more time...
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Probably, the error is because of code in some of these events:
OnCaretMove, OnCurTextStyleChanged, OnCurParaStyleChanged.
softtouch
Posts: 49
Joined: Thu Sep 15, 2005 5:56 am

Post 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?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post 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;
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

And which of these functions generates error?
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post by Marsianin »

As I said above - linescount:=GetLineNo(ItemCount-1,GetOffsAfterItem(ItemCount-1))
Marsianin
Posts: 193
Joined: Sun Sep 25, 2005 11:03 pm

Post 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 ?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Will be fixed in the next update
Post Reply