void InsetMathGrid::addCol(col_type newcol)
{
        const col_type nc = ncols();
        const row_type nr = nrows();
        cells_type new_cells((nc + 1) * nr);
        vector<CellInfo> new_cellinfo((nc + 1) * nr);

        for (row_type row = 0; row < nr; ++row)
                for (col_type col = 0; col < nc; ++col) {
                        new_cells[row * (nc + 1) + col + (col > newcol)]      
<---
                                = cells_[row * nc + col];
                        new_cellinfo[row * (nc + 1) + col + (col > newcol)]   
<---
                                = cellinfo_[row * nc + col];
                }
        swap(cells_, new_cells);
        swap(cellinfo_, new_cellinfo);

        ColInfo inf;
        inf.skip_  = defaultColSpace(newcol);
        inf.align_ = defaultColAlign(newcol);
        colinfo_.insert(colinfo_.begin() + newcol, inf);
}

This function is apparently supposed to insert a new column at position
newcol. I understand that columns (and rows and cells) start counting
at 0. What I don't understand it what happens with the indicated (col >
newcol). What this will do is shift the contents of the current column
one place to the right, for all columns to the right of the new column.
*The content of the current column doesn't get shifted* and stays in
what is supposed to be a new, empty column. It the next one that will
remain empty, but with old spacing/alignment data AFAICS.

Is this intentional or a bug?

- Martin


BTW Abdel, mathed placeholders now render OK, but they still believe
their size is 0 :-(

Reply via email to