]> git.lyx.org Git - features.git/commitdiff
- GuiTabular.cpp: longtables cannot have a vertical alignment
authorUwe Stöhr <uwestoehr@web.de>
Sat, 11 Jul 2009 14:33:05 +0000 (14:33 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sat, 11 Jul 2009 14:33:05 +0000 (14:33 +0000)
- InsetTabular.cpp: write the alignment as last features (to match the existing tex2lyx routines)
- InsetTabular.h: fix indexes

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

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

index c162f1fa0cd234487f9a44975fa84cfc9e81893c..91b68678a682101c8f44b729b7b4a475b35de334 100644 (file)
@@ -84,6 +84,9 @@ GuiTabular::GuiTabular(GuiView & lv)
                newpageCB, SLOT(setEnabled(bool)));
        connect(longTabularCB, SIGNAL(toggled(bool)),
                alignmentGB, SLOT(setEnabled(bool)));
+       // longtables cannot have a vertical alignment
+       connect(longTabularCB, SIGNAL(toggled(bool)),
+               TableAlignCB, SLOT(setDisabled(bool)));
        connect(hAlignCB, SIGNAL(activated(int)),
                this, SLOT(hAlign_changed(int)));
        connect(vAlignCB, SIGNAL(activated(int)),
@@ -826,7 +829,7 @@ void GuiTabular::updateContents()
        hAlignCB->setEnabled(true);
        vAlignCB->setEnabled(!pwidth.zero());
 
-       int tableValign = 0;
+       int tableValign = 1;
        switch (tabular_.tabular_valignment) {
        case Tabular::LYX_VALIGN_TOP:
                tableValign = 0;
@@ -864,7 +867,9 @@ void GuiTabular::updateContents()
                captionStatusCB->setChecked(false);
                captionStatusCB->blockSignals(false);
                return;
-       }
+       } else
+               // longtables cannot have a vertical alignment
+               TableAlignCB->setCurrentIndex(Tabular::LYX_VALIGN_MIDDLE);
 
        switch (tabular_.longtabular_alignment) {
        case Tabular::LYX_LONGTABULAR_ALIGN_LEFT:
index 3511dd4693fc1c9f94bcf1533274925c8b551d28..842f9cc1d414eb166985fdd9a93785f149850e5b 100644 (file)
@@ -1326,14 +1326,8 @@ void Tabular::write(ostream & os) const
        os << "<features"
           << write_attribute("rotate", rotate)
           << write_attribute("booktabs", use_booktabs)
-          << 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("islongtable", is_long_tabular)
+          << write_attribute("firstHeadTopDL", endfirsthead.topDL)
           << write_attribute("firstHeadBottomDL", endfirsthead.bottomDL)
           << write_attribute("firstHeadEmpty", endfirsthead.empty)
           << write_attribute("headTopDL", endhead.topDL)
@@ -1342,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)
index 905fdcd98c66fece6f2d1b087a4cf30bd584e47c..3f516e05a2ac5ab27bb3d7dd89aa35a9afdcc9e6 100644 (file)
@@ -207,9 +207,10 @@ public:
                ///
                LYX_VALIGN_TOP = 0,
                ///
-               LYX_VALIGN_BOTTOM = 1,
+               LYX_VALIGN_MIDDLE = 1,
                ///
-               LYX_VALIGN_MIDDLE = 2
+               LYX_VALIGN_BOTTOM = 2
+               
        };
        ///
        enum HAlignment {