]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.cpp
- GuiTabular.cpp: longtables cannot have a vertical alignment
[lyx.git] / src / insets / InsetTabular.cpp
index 001be8e7d71438fe09864873aebc3fe5a2bff045..842f9cc1d414eb166985fdd9a93785f149850e5b 100644 (file)
@@ -1327,8 +1327,6 @@ void Tabular::write(ostream & os) const
           << write_attribute("rotate", rotate)
           << write_attribute("booktabs", use_booktabs)
           << write_attribute("islongtable", is_long_tabular)
-          << write_attribute("tabularvalignment", tabular_valignment)
-          << write_attribute("longtabularalignment", longtabular_alignment)
           << write_attribute("firstHeadTopDL", endfirsthead.topDL)
           << write_attribute("firstHeadBottomDL", endfirsthead.bottomDL)
           << write_attribute("firstHeadEmpty", endfirsthead.empty)
@@ -1338,8 +1336,14 @@ void Tabular::write(ostream & os) const
           << write_attribute("footBottomDL", endfoot.bottomDL)
           << write_attribute("lastFootTopDL", endlastfoot.topDL)
           << write_attribute("lastFootBottomDL", endlastfoot.bottomDL)
-          << write_attribute("lastFootEmpty", endlastfoot.empty)
-          << ">\n";
+          << write_attribute("lastFootEmpty", endlastfoot.empty);
+       // longtables cannot be aligned vertically
+       if (!is_long_tabular)
+          os << write_attribute("tabularvalignment", tabular_valignment);
+       if (is_long_tabular)
+          os << write_attribute("longtabularalignment",
+                                longtabular_alignment);
+       os << ">\n";
        for (col_type j = 0; j < column_info.size(); ++j) {
                os << "<column"
                   << write_attribute("alignment", column_info[j].alignment)
@@ -4166,6 +4170,8 @@ Inset::DisplayType InsetTabular::display() const
                                return AlignCenter;
                        case Tabular::LYX_LONGTABULAR_ALIGN_RIGHT:
                                return AlignRight;
+                       default:
+                               return AlignCenter;
                        }
                } else
                        return Inline;