]> git.lyx.org Git - lyx.git/commitdiff
Disable non-functional table rotation for longtables
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 19 Nov 2017 13:32:53 +0000 (14:32 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 20 Nov 2017 08:37:01 +0000 (09:37 +0100)
In the long run, proper longtable rotation via [pdf]lscape should
be implemented.

See #9194

(cherry picked from commit 84f7dafe891483e0314e2a08c0ddd8cf0063902d)

src/frontends/qt4/GuiTabular.cpp
src/insets/InsetTabular.cpp

index 2741a3715e2913ecbe26479e2468ba4f2eb5e944..151a714ae974d976bc6b8ea8cc68e810fdbafe63 100644 (file)
@@ -258,6 +258,12 @@ void GuiTabular::enableWidgets() const
        // longtables and tabular* cannot have a vertical alignment
        TableAlignLA->setDisabled(is_tabular_star || longtabular);
        TableAlignCO->setDisabled(is_tabular_star || longtabular);
+       // longtable cannot be rotated (with rotating package)
+       // FIXME: Add support for [pdf]lscape
+       rotateTabularCB->setDisabled(longtabular);
+       rotateTabularLA->setDisabled(longtabular);
+       // this one would also be disabled with [pdf]lscape
+       rotateTabularAngleSB->setDisabled(longtabular);
 
        // FIXME: This Dialog is really horrible, disabling/enabling a checkbox
        // depending on the cursor position is very very unintuitive...
index b209053f45909cf8dbf24aa5472bd9221a73f5d0..788858e189a2497d50f7c6d4892c5ca7192c4d21 100644 (file)
@@ -1860,7 +1860,7 @@ int Tabular::getRotateCell(idx_type cell) const
 
 bool Tabular::needRotating() const
 {
-       if (rotate)
+       if (rotate && !is_long_tabular)
                return true;
        for (row_type r = 0; r < nrows(); ++r)
                for (col_type c = 0; c < ncols(); ++c)
@@ -2719,7 +2719,7 @@ void Tabular::latex(otexstream & os, OutputParams const & runparams) const
        if (!TexRow::isNone(pos))
                os.texrow().start(pos);
 
-       if (rotate != 0)
+       if (rotate != 0 && !is_long_tabular)
                os << "\\begin{turn}{" << convert<string>(rotate) << "}\n";
 
        if (is_long_tabular) {
@@ -2870,7 +2870,7 @@ void Tabular::latex(otexstream & os, OutputParams const & runparams) const
                        os << "\\end{tabular}";
        }
 
-       if (rotate != 0)
+       if (rotate != 0 && !is_long_tabular)
                os << breakln << "\\end{turn}";
 
        if (!TexRow::isNone(pos))