Jürgen> On 02-May-2000 Angus Leeming wrote:
Jürgen> > cxx: Error: table.C, line 235: a new-initializer may not be specified for an
array
Jürgen> > cell_info[i] = new cellstruct[columns](buffer);
Jürgen> I don't understand this. Would it help to have:
Jürgen> cellstruct(Buffer * buf);
Jürgen> instead of:
Jürgen> cellstruct(Buffer * buf=0);
Afraid not, Jürgen. I get the same error. In fact, I have also to define a
default constuctor (see below). This seems like a compiler bug to me (not
knowing much!). Does Jean-Marc have a more modern version of DEC cxx? Mine is
DIGITAL C++ V6.1-029 on DIGITAL UNIX V4.0 (Rev. 1091)
Jean-Marc? Can you compile table.C or tabular.C with cxx?
Angus
I experimented in tabular.C because the code is identical and the compile times
less.
void LyXTabular::Init(int rows_arg, int columns_arg)
{
.
.
.
cell_info = new cellstruct*[rows_];
int cellno = 0;
for (i = 0; i < rows_; ++i) {
cell_info[i] = new cellstruct[columns_];
for (j = 0; j < columns_; ++j) {
cell_info[i][j].setBuffer(buffer);
cell_info[i][j].cellno = cellno++;
}
}
.
.
.
}
LyXTabular::cellstruct::cellstruct() {
init();
}
LyXTabular::cellstruct::cellstruct(Buffer * buf) {
init();
setBuffer(buf);
}
void LyXTabular::cellstruct::init() {
cellno = 0; //should be initilaized correctly later.
width_of_cell = 0;
multicolumn = LyXTabular::CELL_NORMAL;
alignment = LYX_ALIGN_CENTER;
top_line = true;
bottom_line = false;
rotate = false;
linebreaks = false;
}
void LyXTabular::cellstruct::setBuffer(Buffer * buf)
{
if (inset) delete inset;
inset = new InsetText(buf);
}