]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
tex2lyx/text.cpp: fix typos
[lyx.git] / src / insets / InsetTabular.cpp
index 113bd99028407e10fb517731772d6bf95b138a09..8e796dbbf9561832593ecaab76b0c3fe7fe86cf1 100644 (file)
@@ -165,6 +165,7 @@ TabularFeature tabularFeature[] =
        { Tabular::SET_LTLASTFOOT, "set-ltlastfoot", true },
        { Tabular::UNSET_LTLASTFOOT, "unset-ltlastfoot", true },
        { Tabular::SET_LTNEWPAGE, "set-ltnewpage", false },
+       { Tabular::UNSET_LTNEWPAGE, "unset-ltnewpage", false },
        { Tabular::TOGGLE_LTCAPTION, "toggle-ltcaption", false },
        { Tabular::SET_LTCAPTION, "set-ltcaption", false },
        { Tabular::UNSET_LTCAPTION, "unset-ltcaption", false },
@@ -2600,7 +2601,7 @@ void Tabular::latex(otexstream & os, OutputParams const & runparams) const
                os.texrow().start(runparams.lastid, runparams.lastpos);
 
        if (rotate != 0)
-               os << "\\begin{turn}" << convert<string>(rotate) << "\n";
+               os << "\\begin{turn}{" << convert<string>(rotate) << "}\n";
 
        if (is_long_tabular) {
                os << "\\begin{longtable}";
@@ -4544,8 +4545,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
 
                case Tabular::TOGGLE_ROTATE_TABULAR:
                case Tabular::SET_ROTATE_TABULAR:
-                       status.setEnabled(tabular.tabular_width.zero());
-                       status.setOnOff(tableIsRotated());
+                       status.setOnOff(tabular.rotate != 0);
                        break;
 
                case Tabular::TABULAR_VALIGN_TOP:
@@ -4578,7 +4578,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
                        break;
 
                case Tabular::UNSET_ROTATE_TABULAR:
-                       status.setOnOff(!tableIsRotated());
+                       status.setOnOff(tabular.rotate == 0);
                        break;
 
                case Tabular::TOGGLE_ROTATE_CELL:
@@ -4641,6 +4641,9 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
                case Tabular::SET_LTNEWPAGE:
                        status.setOnOff(tabular.getLTNewPage(sel_row_start));
                        break;
+               case Tabular::UNSET_LTNEWPAGE:
+                       status.setOnOff(!tabular.getLTNewPage(sel_row_start));
+                       break;
 
                // only one row in head/firsthead/foot/lasthead can be the caption
                // and a multirow cannot be set as caption
@@ -5196,13 +5199,6 @@ bool InsetTabular::oneCellHasRotationState(bool rotated,
        return false;
 }
 
-bool InsetTabular::tableIsRotated() const 
-{
-       if (tabular.rotate != 0)
-               return true;
-       else
-               return false;
-}
 
 void InsetTabular::tabularFeatures(Cursor & cur,
        Tabular::Feature feature, string const & value)
@@ -5566,10 +5562,7 @@ void InsetTabular::tabularFeatures(Cursor & cur,
 
        case Tabular::TOGGLE_ROTATE_TABULAR:
                // when pressing the rotate button we default to 90° rotation
-               if (tableIsRotated())
-                       tabular.rotate = 90;
-               else
-                       tabular.rotate = 0;
+               tabular.rotate != 0 ? tabular.rotate = 0 : tabular.rotate = 90;
                break;
 
        case Tabular::TABULAR_VALIGN_TOP:
@@ -5668,8 +5661,10 @@ void InsetTabular::tabularFeatures(Cursor & cur,
                tabular.setLTFoot(row, flag, ltt, true);
                break;
 
+       case Tabular::UNSET_LTNEWPAGE:
+               flag = false;
        case Tabular::SET_LTNEWPAGE:
-               tabular.setLTNewPage(row, !tabular.getLTNewPage(row));
+               tabular.setLTNewPage(row, flag);
                break;
 
        case Tabular::SET_LTCAPTION: {