Page 1 of 1
insertrows and font size
Posted: Tue Mar 24, 2009 1:12 am
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.
Posted: Tue Mar 24, 2009 5:24 pm
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.
Posted: Wed Mar 25, 2009 9:34 am
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
Posted: Wed Mar 25, 2009 4:19 pm
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.