]> git.lyx.org Git - features.git/commitdiff
bit of clean up
authorEdwin Leuven <e.leuven@gmail.com>
Fri, 19 Feb 2010 22:00:54 +0000 (22:00 +0000)
committerEdwin Leuven <e.leuven@gmail.com>
Fri, 19 Feb 2010 22:00:54 +0000 (22:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33522 a592a061-630c-0410-9148-cb99ea01b6c8

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

index d6213afcc353cdff34a3ef807b89e499ae4e1eb7..6c628049ac4e5fd7dd0562afe2030b1435c78796 100644 (file)
@@ -867,32 +867,6 @@ bool Tabular::rightLine(idx_type cell) const
 }
 
 
-bool Tabular::topAlreadyDrawn(idx_type cell) const
-{
-       row_type const row = cellRow(cell);
-       if (row == 0)
-               return false;
-       
-       return !rowTopLine(row) && bottomLine(cellAbove(cell));
-}
-
-
-bool Tabular::leftAlreadyDrawn(idx_type cell) const
-{
-       col_type col = cellColumn(cell);
-       if (col == 0)
-               return false;
-       idx_type i = cellIndex(cellRow(cell), col - 1);
-       return rightLine(i) && !leftLine(cell);
-}
-
-
-bool Tabular::isLastRow(idx_type cell) const
-{
-       return cellRow(cell) == row_info.size() - 1;
-}
-
-
 int Tabular::interRowSpace(row_type row) const
 {
        if (!row || row >= row_info.size())
@@ -3460,7 +3434,10 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y,
                onoffcol = change.color();
        }
 
-       if (!tabular.topAlreadyDrawn(cell)) {
+       bool topalreadydrawn = row > 0 && !tabular.rowTopLine(row) 
+               && tabular.bottomLine(tabular.cellAbove(cell));
+
+       if (!topalreadydrawn) {
                on_off = !tabular.topLine(cell);
                pain.line(x, y, x + w, y,
                        on_off ? onoffcol : col,
@@ -3470,7 +3447,12 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int y,
        pain.line(x, y + h, x + w, y + h,
                on_off ? onoffcol : col,
                on_off ? Painter::line_onoffdash : Painter::line_solid);
-       if (!tabular.leftAlreadyDrawn(cell)) {
+
+       col_type const column = tabular.cellColumn(cell);
+       bool leftalreadydrawn = column > 0  && !tabular.leftLine(cell)
+               && tabular.rightLine(tabular.cellIndex(row, column - 1));
+
+       if (!leftalreadydrawn) {
                on_off = !tabular.leftLine(cell);
                pain.line(x, y, x, y + h,
                        on_off ? onoffcol : col,
index 8e2b20d0de87cd5ebc2061e7e5cc2c8b1a70a87c..545deb080f343fbad10ca132b85289bc270c14eb 100644 (file)
@@ -272,13 +272,6 @@ public:
        /// Returns true if there is a topline, returns false if not
        bool rightLine(idx_type cell) const;
 
-       ///
-       bool topAlreadyDrawn(idx_type cell) const;
-       ///
-       bool leftAlreadyDrawn(idx_type cell) const;
-       ///
-       bool isLastRow(idx_type cell) const;
-
        /// return space occupied by the second horizontal line and
        /// interline space above row \p row in pixels
        int interRowSpace(row_type row) const;