I have some problems with loading rvf into table. I have five RVF files containing short texts ( font Time New Roman, various font size ). When I try to load them into TRichViewEdit using this code
Code: Select all
void __fastcall TForm1::btn2Click(TObject *Sender)
{
for ( int i = 0; i < 5; i++ )
{
String sFileName( ExtractFilePath( Application->ExeName) + "rv\\an_" + IntToStr( i ) + ".dat" );
TFileStream * fs = new TFileStream( sFileName, fmOpenRead );
rve->AppendRVFFromStream( dynamic_cast<TStream*>( fs ), 0 );
rve->Format( );
delete fs;
fs = 0;
}
}
Code: Select all
void __fastcall TForm1::btn3Click(TObject *Sender)
{
TRVTableItemInfo * table = new TRVTableItemInfo( 5, 1, rve->RVData );
for ( int i = 0; i < 5; i++ )
{
String sFileName( ExtractFilePath( Application->ExeName) + "rv\\an_" + IntToStr( i ) + ".dat" );
TFileStream * fs = new TFileStream( sFileName, fmOpenRead );
table->Cells[ i ][ 0 ]->Clear( );
table->Cells[ i ][ 0 ]->DeleteUnusedStyles( true, true, true );
table->Cells[ i ][ 0 ]->AppendRVFFromStream( dynamic_cast<TStream*>( fs ), -1, 0, 0 );
table->Cells[ i ][ 0 ]->Format( true );
delete fs;
fs = 0;
}
rve->InsertItem( "table", table );
}
Another thing, that I don't understand is after successful loading rvf files ( directly into RichViewEdit, not into table ), when I check font in text styles:
Code: Select all
void __fastcall TForm1::btn5Click(TObject *Sender)
{
String sMesg( "" );
for ( int i = 0; i < rve->Style->TextStyles->Count; i++ )
{
sMesg += rve->Style->TextStyles->Items[ 0 ]->FontName + " : ";
sMesg += IntToStr( rve->Style->TextStyles->Items[ 0 ]->Size ) + "\n";
}
ShowMessage( sMesg );
}
TRichVeiw settings are:
Styles - Allow adding styles dynamically
RVF Saving - all options checked
RVF Loading - DocProperties, Convert invalid style indices to 0 and Convert invalid imagelist indices to 0 checked, the rest unchecked.
Thanks for any help.
Piotr Jarmo³owicz