]> git.lyx.org Git - features.git/commitdiff
Get rid of InsetTabular::first_visible_cell_
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 18 Jul 2016 10:24:31 +0000 (12:24 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 18 Jul 2016 10:26:06 +0000 (12:26 +0200)
The code that uses it has been commented out since 2004. It is time to
delete it.

src/insets/InsetTabular.cpp
src/insets/InsetTabular.h

index 0834f1a68fa13384e88c4b72e37ecb07e21b1283..aa7b01bef72c835f6812be4e8918dc6bce59e23f 100644 (file)
@@ -3487,14 +3487,14 @@ docstring InsetTableCell::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 InsetTabular::InsetTabular(Buffer * buf, row_type rows,
                           col_type columns)
        : Inset(buf), tabular(buf, max(rows, row_type(1)), max(columns, col_type(1))),
-         first_visible_cell_(0), offset_valign_(0), rowselect_(false), colselect_(false)
+         offset_valign_(0), rowselect_(false), colselect_(false)
 {
 }
 
 
 InsetTabular::InsetTabular(InsetTabular const & tab)
        : Inset(tab), tabular(tab.tabular),
-         first_visible_cell_(0), offset_valign_(0), rowselect_(false), colselect_(false)
+         offset_valign_(0), rowselect_(false), colselect_(false)
 {
 }
 
@@ -3757,7 +3757,6 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
        bool const original_selection_state = pi.selected;
 
        idx_type idx = 0;
-       first_visible_cell_ = Tabular::npos;
 
        int yy = y + offset_valign_;
        for (row_type r = 0; r < tabular.nrows(); ++r) {
@@ -3773,9 +3772,6 @@ void InsetTabular::draw(PainterInfo & pi, int x, int y) const
                                continue;
                        }
 
-                       if (first_visible_cell_ == Tabular::npos)
-                               first_visible_cell_ = idx;
-
                        pi.selected |= isCellSelected(cur, r, c);
                        int const cx = nx + tabular.textHOffset(idx);
                        int const cy = yy + tabular.textVOffset(idx);
@@ -4297,41 +4293,6 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.screenUpdateFlags(Update::Force | Update::FitCursor);
                break;
 
-//     case LFUN_SCREEN_DOWN: {
-//             //if (hasSelection())
-//             //      cur.selection() = false;
-//             col_type const col = tabular.cellColumn(cur.idx());
-//             int const t =   cur.bv().top_y() + cur.bv().height();
-//             if (t < yo() + tabular.getHeightOfTabular()) {
-//                     cur.bv().scrollDocView(t, true);
-//                     cur.idx() = tabular.cellBelow(first_visible_cell_) + col;
-//             } else {
-//                     cur.idx() = tabular.getFirstCellInRow(tabular.rows() - 1) + col;
-//             }
-//             cur.par() = 0;
-//             cur.pos() = 0;
-//             break;
-//     }
-//
-//     case LFUN_SCREEN_UP: {
-//             //if (hasSelection())
-//             //      cur.selection() = false;
-//             col_type const col = tabular.cellColumn(cur.idx());
-//             int const t =   cur.bv().top_y() + cur.bv().height();
-//             if (yo() < 0) {
-//                     cur.bv().scrollDocView(t, true);
-//                     if (yo() > 0)
-//                             cur.idx() = col;
-//                     else
-//                             cur.idx() = tabular.cellBelow(first_visible_cell_) + col;
-//             } else {
-//                     cur.idx() = col;
-//             }
-//             cur.par() = cur.lastpar();
-//             cur.pos() = cur.lastpos();
-//             break;
-//     }
-
        case LFUN_LAYOUT_TABULAR:
                cur.bv().showDialog("tabular");
                break;
index 565b97332d75dc7e32056f9ce20efe5bbdc1b26e..bc0d2033bd0d37b39126582408d279e7848eba23 100644 (file)
@@ -1055,8 +1055,6 @@ private:
        bool oneCellHasRotationState(bool rotated,
                                row_type row_start, row_type row_end,
                                col_type col_start, col_type col_end) const;
-       ///
-       mutable idx_type first_visible_cell_;
        /// The vertical offset of the table due to the vertical
        /// alignment with respect to the baseline.
        mutable int offset_valign_;