Martin Vermeer wrote:

> +void MathGridInset::horLine(row_type row)
> +{
> +        if (nrows() == 1)
> +                return;
> +        if (row + 1 == nrows())
> +                --row;
> +        rowinfo_[row].lines_++;
> +}

I don't understand this. I understand that this method adds a line above the
row. I would think that it should look like

void MathGridInset::addHLineAbove(row_type row)
{
        if (row == 0)
                // Only if we don't want a line above the first row;
                return;
        if (row >= nrows())
                return;
        rowinfo_[row].lines_++;
}

IMO it should simply return if the line cannot be added.
Another question: What about lines above the first row and below the last? I
believe that this is possible in LaTeX, but how to support it here? I can't
think of a better way than having an addHLineBelow() etc.

And getStatus needs to be updated to disable addHLineAbove if the cursor is
in the first row.
Of course the same things should be done for the other h- and vline methods.

> @@ -1100,6 +1140,10 @@
>                                  copyRow(cur.row());
>                  else if (s == "swap-row")
>                          swapRow(cur.row());
> +                else if (s == "hor-line")
> +                        horLine(cur.row());
> +                else if (s == "delete-hor-line")
> +                        rmHorLine(cur.row());

I would prefer add-hline-above, delete-hline-above etc.


Georg

Reply via email to