Re: That pesky first item

Return to index



Martin Holmes

Posted: 02/23/2005 16:32:57

Hi Sergey,

The problem is this:

If I'm processing the first paragraph in a table cell, then what I need

to do is to set the paragraph style. If it's a subsequent paragraph, I

need to use AddNLWTag. So I have code like this:

if RVD.ItemCount > 0 then

                        RVD.AddNLWTag('', 0, StyleNum, 0)



                     RVE.CurParaStyleNo := StyleNum;

where RVD is the TRVCustomData (in this case of the table cell), and RVE

is the main TRichViewEdit. I would like to use


but I can't, of course, because it doesn't have that method. If I use

AddNLWTag even it it's the first item, then I get that first blank line.

If I don't call RVE.Format, then I get an error when I try to use


Text is added later as text nodes appear in the source document; that's

why I'm adding an empty paragraph here.

Do you have any suggestions here?



Sergey Tkachenko wrote:

> You can add data to table cell in the same way as in the main editor, using

> Add*** methods (AddItem, AddNL, etc.).

> Moreover, you can (and should) reuse the code adding data to them main

> editor and to cells (for the main editor, use RichViewEdit.RVData, for

> cells - use cells themselves).

> Avoid using method working with selection and caret position when generating

> documents.




>>If I avoid calling Format, then I get an error when I add a table, then

>>start adding data inside the table cells. The error is thrown inside

>>TCustomRVFormattedData.RestoreSelBounds, and it's a "list index out of

>>bounds" error. The issue seems to be related to calling RVData.Edit on

>>the table cell; if the document isn't formatted, I can't call that

>>because it generates the error, and I don't think I can add data to a

>>table cell without calling Edit, can I?




Powered by ABC Amber Outlook Express Converter