]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettabular.C
use more specific smart_ptr headers
[lyx.git] / src / insets / insettabular.C
index cc08993905f6f8b7da75ac7b3644fa89e525883a..d7c59e82bf5ee72093e0234ab0f982a1443d606a 100644 (file)
@@ -450,8 +450,8 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int baseline,
                          on_off ? Painter::line_onoffdash : Painter::line_solid);
        }
        on_off = !tabular->BottomLine(cell);
-       pain.line(x,baseline +  tabular->GetDescentOfRow(row),
-                 x2, baseline +  tabular->GetDescentOfRow(row),
+       pain.line(x, baseline + tabular->GetDescentOfRow(row),
+                 x2, baseline + tabular->GetDescentOfRow(row),
                  on_off ? LColor::tabularonoffline : LColor::tabularline,
                  on_off ? Painter::line_onoffdash : Painter::line_solid);
        if (!tabular->LeftAlreadyDrawed(cell)) {
@@ -491,8 +491,8 @@ void InsetTabular::drawCellSelection(Painter & pain, int x, int baseline,
 
        if ((column >= cs) && (column <= ce) && (row >= rs) && (row <= re)) {
                int w = tabular->GetWidthOfColumn(cell);
-               int h = tabular->GetAscentOfRow(row) + tabular->GetDescentOfRow(row);
-               pain.fillRectangle(x, baseline - tabular->GetAscentOfRow(row),
+               int h = tabular->GetAscentOfRow(row) + tabular->GetDescentOfRow(row)-1;
+               pain.fillRectangle(x, baseline - tabular->GetAscentOfRow(row) + 1,
                                   w, h, LColor::selection);
        }
 }
@@ -1479,6 +1479,7 @@ void InsetTabular::fitInsetCursor(BufferView * bv) const
 
        int const asc = lyxfont::maxAscent(font);
        int const desc = lyxfont::maxDescent(font);
+       resetPos(bv);
        if (bv->fitLockedInsetCursor(cursor_.x(), cursor_.y(), asc, desc))
                need_update = FULL;
 }
@@ -2828,7 +2829,7 @@ bool InsetTabular::insertAsciiString(BufferView * bv, string const & buf,
 {
        if (buf.length() <= 0)
                return true;
-       
+
        int cols = 1;
        int rows = 1;
        int maxCols = 1;