]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
* src/insets/InsetSpace.cpp:
[lyx.git] / src / insets / InsetTabular.cpp
index 462029dabeee61e960648d9dfd62c27b5ff42ab8..11d0fe6f2e5f64ea6383ccdb180366af77cd041c 100644 (file)
 #include "frontends/Painter.h"
 #include "frontends/Selection.h"
 
-#include "support/lassert.h"
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/FileName.h"
 #include "support/gettext.h"
+#include "support/lassert.h"
 #include "support/lstrings.h"
 
 #include <boost/scoped_ptr.hpp>
@@ -1096,7 +1096,7 @@ bool Tabular::columnLeftLine(col_type c) const
                                ++nrows_left;
                }
        }
-       return nrows_left >= total / 2;
+       return 2 * nrows_left >= total;
 }
 
 
@@ -1119,7 +1119,7 @@ bool Tabular::columnRightLine(col_type c) const
                                ++nrows_right;
                }
        }
-       return nrows_right >= total / 2;
+       return 2 * nrows_right >= total;
 }
 
 
@@ -1865,7 +1865,6 @@ int Tabular::TeXCellPreamble(odocstream & os, idx_type cell, bool & ismulticol)
                && leftLine(cellIndex(r, nextcol));
        bool coldouble = colright && nextcolleft;
        bool celldouble = rightLine(cell) && nextcellleft;
-       bool prevcellright = c > 0 && rightLine(cellIndex(r, c - 1));
        ismulticol = isMultiColumn(cell) 
                || (c == 0 && colleft != leftLine(cell))
                || ((colright || nextcolleft) && !rightLine(cell) && !nextcellleft)
@@ -1873,7 +1872,7 @@ int Tabular::TeXCellPreamble(odocstream & os, idx_type cell, bool & ismulticol)
                || (coldouble != celldouble);
        if (ismulticol) {
                os << "\\multicolumn{" << columnSpan(cell) << "}{";
-               if (leftLine(cell) || prevcellright)
+               if (c ==0 && leftLine(cell))
                        os << '|';
                if (!cellInfo(cell).align_special.empty()) {
                        os << cellInfo(cell).align_special;
@@ -3456,8 +3455,8 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
        case LFUN_FONT_FRAK:
        case LFUN_FONT_TYPEWRITER:
        case LFUN_FONT_SANS:
-       case LFUN_FONT_FREE_APPLY:
-       case LFUN_FONT_FREE_UPDATE:
+       case LFUN_TEXTSTYLE_APPLY:
+       case LFUN_TEXTSTYLE_UPDATE:
        case LFUN_FONT_SIZE:
        case LFUN_FONT_UNDERLINE:
        case LFUN_LANGUAGE:
@@ -3746,8 +3745,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        // disable in non-fixed-width cells
        case LFUN_NEWLINE_INSERT:
-       case LFUN_BREAK_PARAGRAPH:
-       case LFUN_BREAK_PARAGRAPH_SKIP: {
+       case LFUN_BREAK_PARAGRAPH: {
                if (tabular.getPWidth(cur.idx()).zero()) {
                        status.setEnabled(false);
                        return true;