Possible table bug
Posted: Thu Feb 21, 2008 2:42 pm
With this code following, i get List Index Out of bounds error, but ONLY for last version registered RichView, with the Unregistered version it works !!!!
This line is the problem:
table->InsertRows(table->Rows->Count,1,0,false);
I managed to insert new rows but only with:
table->Rows->Insert(table->Rows->Count,table->ColCount);
InsertRows just gives error
If is this a bug please tell me what lines to modify in component, i am in hurry to release the update today, and i cannot wait until next release. Or if something has changed in sintax please advise.
Code:
table = new TRVTableItemInfo(4,4, RichView1->RVData);
int r,c;
table->BorderWidth = 1;
table->CellBorderWidth = 1;
table->CellBorderStyle = rvtbColor;
table->CellBorderColor = clBtnFace;
table->BorderStyle = rvtbColor;
for (r=0; r<table->Rows->Count; r++)
for (c=0; c<table->Rows->Items[r]->Count; c++)
{
table->Cells[r][c]->Clear();
table->Cells[r][c]->Color = 0x00E6E6E6;
}
table->SetTableVisibleBorders(0,0,0,0);
for(int i = 0; i<4; i++)
{
table->SetCellVisibleBorders(0,0,0,0,i,0);
table->Cells[0]->Color = clWhite;
}
for(int i = 0; i<4; i++)
{
table->SetCellVisibleBorders(0,0,0,0,i,3);
table->Cells[3]->Color = clWhite;
}
table->Cells[0][1]->AddNL("Brand",5,1);
table->Cells[1][1]->AddNL("Model",5,1);
table->Cells[2][1]->AddNL("Type",5,1);
table->Cells[3][1]->AddNL("Option",5,1);
table->SetCellBestWidth(200,0,1);
table->SetCellBestWidth(200,0,2);
table->Cells[0][2]->AddNL("gggg",3,1);
table->Cells[1][2]->AddNL("hhhhhh",3,1);
table->Cells[2][2]->AddNL("tttttt",3,1);
table->Cells[3][2]->AddNL("6666666",3,1);
table->InsertRows(table->Rows->Count,1,0,false);
RichView1->AddItem("Spreadsheet", table);
RichView1->Format();
Regards
Vlad
This line is the problem:
table->InsertRows(table->Rows->Count,1,0,false);
I managed to insert new rows but only with:
table->Rows->Insert(table->Rows->Count,table->ColCount);
InsertRows just gives error
If is this a bug please tell me what lines to modify in component, i am in hurry to release the update today, and i cannot wait until next release. Or if something has changed in sintax please advise.
Code:
table = new TRVTableItemInfo(4,4, RichView1->RVData);
int r,c;
table->BorderWidth = 1;
table->CellBorderWidth = 1;
table->CellBorderStyle = rvtbColor;
table->CellBorderColor = clBtnFace;
table->BorderStyle = rvtbColor;
for (r=0; r<table->Rows->Count; r++)
for (c=0; c<table->Rows->Items[r]->Count; c++)
{
table->Cells[r][c]->Clear();
table->Cells[r][c]->Color = 0x00E6E6E6;
}
table->SetTableVisibleBorders(0,0,0,0);
for(int i = 0; i<4; i++)
{
table->SetCellVisibleBorders(0,0,0,0,i,0);
table->Cells[0]->Color = clWhite;
}
for(int i = 0; i<4; i++)
{
table->SetCellVisibleBorders(0,0,0,0,i,3);
table->Cells[3]->Color = clWhite;
}
table->Cells[0][1]->AddNL("Brand",5,1);
table->Cells[1][1]->AddNL("Model",5,1);
table->Cells[2][1]->AddNL("Type",5,1);
table->Cells[3][1]->AddNL("Option",5,1);
table->SetCellBestWidth(200,0,1);
table->SetCellBestWidth(200,0,2);
table->Cells[0][2]->AddNL("gggg",3,1);
table->Cells[1][2]->AddNL("hhhhhh",3,1);
table->Cells[2][2]->AddNL("tttttt",3,1);
table->Cells[3][2]->AddNL("6666666",3,1);
table->InsertRows(table->Rows->Count,1,0,false);
RichView1->AddItem("Spreadsheet", table);
RichView1->Format();
Regards
Vlad