]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.C
Fixed cut&paste bugs and added freespacing for ERT Insets.
[lyx.git] / src / tabular.C
index 0c201c501ac683d896a3486532a13cda2c518e75..1445ad1818e07dd13337623881ad1980f65c4e04 100644 (file)
@@ -26,7 +26,7 @@
 #include "debug.h"
 #include "vspace.h"
 #include "layout.h"
-#include "lyx_gui_misc.h"
+#include "frontends/Alert.h"
 #include "buffer.h"
 #include "BufferView.h"
 #include "Painter.h"
@@ -266,9 +266,6 @@ void LyXTabular::AppendRow(int cell)
 
 void LyXTabular::DeleteRow(int row)
 {
-       // Why make it so hard? (Lgb)
-       //if (!(rows_ - 1))
-       //return;
        if (rows_ == 1) return; // Not allowed to delete last row
        
        row_info.erase(row_info.begin() + row); //&row_info[row]);
@@ -1442,7 +1439,7 @@ void LyXTabular::OldFormatRead(LyXLex & lex, string const & fl)
                lyxerr << "Tabular format < 5 is not supported anymore\n"
                        "Get an older version of LyX (< 1.1.x) for conversion!"
                           << endl;
-               WriteAlert(_("Warning:"),
+               Alert::alert(_("Warning:"),
                                   _("Tabular format < 5 is not supported anymore\n"),
                                   _("Get an older version of LyX (< 1.1.x) for conversion!"));
                if (version > 2) {
@@ -2215,6 +2212,7 @@ int LyXTabular::Latex(Buffer const * buf,
                        ++cell;
                }
                os << "\\\\\n";
+               ++ret;
                ret += TeXBottomHLine(os, i);
                if (IsLongTabular()) {
                        if (i == (endhead.row - 1)) {
@@ -2620,12 +2618,12 @@ InsetText * LyXTabular::GetCellInset(int row, int column) const
 void LyXTabular::Validate(LaTeXFeatures & features) const
 {
        if (IsLongTabular())
-               features.longtable = true;
+               features.require("longtable");
        if (NeedRotating())
-               features.rotating = true;
-       for (int cell = 0; !features.array && (cell < numberofcells); ++cell) {
+               features.require("rotating");
+       for (int cell = 0; !features.isRequired("array") && (cell < numberofcells); ++cell) {
                if (GetVAlignment(cell) != LYX_VALIGN_TOP)
-                       features.array = true;
+                       features.require("array");
                GetCellInset(cell)->validate(features);
        }
 }
@@ -2651,16 +2649,9 @@ LyXTabular::BoxType LyXTabular::UseParbox(int cell) const
 
        for (; par; par = par->next()) {
                for (int i = 0; i < par->size(); ++i) {
-                       if (par->getChar(i)     == Paragraph::META_NEWLINE)
+                       if (par->getChar(i) == Paragraph::META_NEWLINE)
                                return BOX_PARBOX;
                }
        }
        return BOX_NONE;
 }
-
-/* Emacs:
- * Local variables:
- * tab-width: 4
- * End:
- * vi:set tabstop=4:
- */