insertrows and font size

General TRichView support forum. Please post your questions here
Post Reply
totaldecodes
Posts: 2
Joined: Mon Mar 23, 2009 9:36 am
Location: United Kingdom
Contact:

insertrows and font size

Post by totaldecodes »

When calling insertrows on a table the font size defaults to 10 even though none of the styles have this font size. How do I make the cells default to a font size of 8 when inserting rows.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

By default, new cells uses TextStyles[0] and ParaStyles[0].
But you can specify the row to copy attributes (including text and paragraph styles) in CopyIndex parameter of InsertRows.
totaldecodes
Posts: 2
Joined: Mon Mar 23, 2009 9:36 am
Location: United Kingdom
Contact:

Post by totaldecodes »

Hi Sergey

It seems to be a bit more complicated than that. The document I am formatting was saved using a different program to the one reformatting it. I have had to use the following line of code to fix it.

ItemsTable.Cells[RowCount, 0].GetRVStyle.TextStyles[0].Size:= 8;

ItemsTable is a TRVTableItemInfo object.

I am assuming that the RichViewEdit is assigning styles at file load time that do not match with those defined at design time.

Jeff
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If the document contains text styles (was saved with rvfoSaveTextStyles in rv.RVFOptions) and loaded in RichView having RVFTextStylesReadMode<>rvf_sIgnore), styles in the document replace existing styles.
Post Reply