]> git.lyx.org Git - features.git/commitdiff
InsetTabular.cpp:
authorUwe Stöhr <uwestoehr@web.de>
Sat, 11 Jul 2009 13:41:34 +0000 (13:41 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sat, 11 Jul 2009 13:41:34 +0000 (13:41 +0000)
- longtables cannot have a valignment, tables not a longtablealignment

- squash a compiler warning

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30478 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetTabular.cpp

index 001be8e7d71438fe09864873aebc3fe5a2bff045..e600d4499bbdd3bf1459f7454d20ca6a9e5f56a8 100644 (file)
@@ -1326,10 +1326,14 @@ void Tabular::write(ostream & os) const
        os << "<features"
           << 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("islongtable", is_long_tabular);
+       // 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 << write_attribute("firstHeadTopDL", endfirsthead.topDL)
           << write_attribute("firstHeadBottomDL", endfirsthead.bottomDL)
           << write_attribute("firstHeadEmpty", endfirsthead.empty)
           << write_attribute("headTopDL", endhead.topDL)
@@ -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;