]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiTabular.cpp
fix completion painting for RTL (inline completion and completion list)
[lyx.git] / src / frontends / qt4 / GuiTabular.cpp
index 5161e7bf04fedc0c5d0303417eb3fc1566550b57..8b8c2dbaf438e73bfaa55e47c1c1023002b24761 100644 (file)
@@ -393,6 +393,13 @@ void GuiTabular::ltNewpage_clicked()
 }
 
 
+void GuiTabular::on_captionStatusCB_toggled()
+{
+       set(Tabular::TOGGLE_LTCAPTION);
+       changed();
+}
+
+
 void GuiTabular::ltHeaderStatus_clicked()
 {
        bool enable = headerStatusCB->isChecked();
@@ -567,11 +574,38 @@ void GuiTabular::update_borders()
 }
 
 
+namespace {
+
+Length getColumnPWidth(Tabular const & t, size_t cell)
+{
+       return t.column_info[t.cellColumn(cell)].p_width;
+}
+
+
+Length getMColumnPWidth(Tabular const & t, size_t cell)
+{
+       if (t.isMultiColumn(cell))
+               return t.cellInfo(cell).p_width;
+       return Length();
+}
+
+
+docstring getAlignSpecial(Tabular const & t, size_t cell, int what)
+{
+       if (what == Tabular::SET_SPECIAL_MULTI)
+               return t.cellInfo(cell).align_special;
+       return t.column_info[t.cellColumn(cell)].align_special;
+}
+
+}
+
+
+
 void GuiTabular::updateContents()
 {
        initialiseParams(string());
 
-       Tabular::idx_type const cell = getActiveCell();
+       size_t const cell = getActiveCell();
 
        Tabular::row_type const row = tabular_.cellRow(cell);
        Tabular::col_type const col = tabular_.cellColumn(cell);
@@ -594,11 +628,11 @@ void GuiTabular::updateContents()
        docstring special;
 
        if (multicol) {
-               special = tabular_.getAlignSpecial(cell, Tabular::SET_SPECIAL_MULTI);
-               pwidth = tabular_.getMColumnPWidth(cell);
+               special = getAlignSpecial(tabular_, cell, Tabular::SET_SPECIAL_MULTI);
+               pwidth = getMColumnPWidth(tabular_, cell);
        } else {
-               special = tabular_.getAlignSpecial(cell, Tabular::SET_SPECIAL_COLUMN);
-               pwidth = tabular_.getColumnPWidth(cell);
+               special = getAlignSpecial(tabular_, cell, Tabular::SET_SPECIAL_COLUMN);
+               pwidth = getColumnPWidth(tabular_, cell);
        }
 
        specialAlignmentED->setText(toqstr(special));
@@ -744,8 +778,14 @@ void GuiTabular::updateContents()
                lastfooterNoContentsCB->setChecked(false);
                newpageCB->setChecked(false);
                newpageCB->setEnabled(false);
+               captionStatusCB->blockSignals(true);
+               captionStatusCB->setChecked(false);
+               captionStatusCB->blockSignals(false);
                return;
        }
+       captionStatusCB->blockSignals(true);
+       captionStatusCB->setChecked(tabular_.ltCaption(row));
+       captionStatusCB->blockSignals(false);
 
        Tabular::ltType ltt;
        bool use_empty;
@@ -828,13 +868,13 @@ void GuiTabular::closeGUI()
        // since the changes update the actual tabular_
        //
        // apply the fixed width values
-       Tabular::idx_type const cell = getActiveCell();
+       size_t const cell = getActiveCell();
        bool const multicol = tabular_.isMultiColumn(cell);
        string width = widgetsToLength(widthED, widthUnit);
        string width2;
 
-       Length llen = tabular_.getColumnPWidth(cell);
-       Length llenMulti = tabular_.getMColumnPWidth(cell);
+       Length llen = getColumnPWidth(tabular_, cell);
+       Length llenMulti = getMColumnPWidth(tabular_, cell);
 
        if (multicol && !llenMulti.zero())
                width2 = llenMulti.asString();
@@ -846,9 +886,9 @@ void GuiTabular::closeGUI()
        docstring sa2;
 
        if (multicol)
-               sa2 = tabular_.getAlignSpecial(cell, Tabular::SET_SPECIAL_MULTI);
+               sa2 = getAlignSpecial(tabular_, cell, Tabular::SET_SPECIAL_MULTI);
        else
-               sa2 = tabular_.getAlignSpecial(cell, Tabular::SET_SPECIAL_COLUMN);
+               sa2 = getAlignSpecial(tabular_, cell, Tabular::SET_SPECIAL_COLUMN);
 
        if (sa1 != sa2) {
                if (multicol)