]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiMathMatrix.cpp
fix completion painting for RTL (inline completion and completion list)
[lyx.git] / src / frontends / qt4 / GuiMathMatrix.cpp
index 53566e7120946dbb575776f25ecf100d6ec813e7..24722b00e835bfb21a62391083e015e6fa027478 100644 (file)
@@ -14,9 +14,8 @@
 
 #include "EmptyTable.h"
 #include "qt_helpers.h"
-#include "support/gettext.h"
 
-#include <sstream>
+#include "FuncRequest.h"
 
 #include <QLineEdit>
 #include <QPushButton>
@@ -28,10 +27,9 @@ namespace lyx {
 namespace frontend {
 
 GuiMathMatrix::GuiMathMatrix(GuiView & lv)
-       : GuiMath(lv, "mathmatrix")
+       : GuiDialog(lv, "mathmatrix", qt_("Math Matrix"))
 {
        setupUi(this);
-       setViewTitle(_("Math Matrix"));
 
        table->setMinimumSize(100, 100);
        rowsSB->setValue(5);
@@ -53,9 +51,9 @@ GuiMathMatrix::GuiMathMatrix(GuiView & lv)
                this, SLOT(rowsChanged(int)));
        connect(columnsSB, SIGNAL(valueChanged(int)),
                this, SLOT(columnsChanged(int)) );
-       connect(valignCO, SIGNAL(highlighted(const QString&)),
+       connect(valignCO, SIGNAL(highlighted(QString)),
                this, SLOT(change_adaptor()));
-       connect(halignED, SIGNAL(textChanged(const QString&)),
+       connect(halignED, SIGNAL(textChanged(QString)),
                this, SLOT(change_adaptor()));
 
        bc().setPolicy(ButtonPolicy::IgnorantPolicy);
@@ -89,15 +87,12 @@ void GuiMathMatrix::slotOK()
 {
        char v_align_c[] = "tcb";
        char const c = v_align_c[valignCO->currentIndex()];
-       string const sh = fromqstr(halignED->text());
-       int const nx = int(columnsSB->value());
-       int const ny = int(rowsSB->value());
-
-       ostringstream os;
-       os << nx << ' ' << ny << ' ' << c << ' ' << sh;
-       dispatchMatrix(os.str().c_str());
-
-       // close the dialog
+       QString const sh = halignED->text();
+       int const nx = columnsSB->value();
+       int const ny = rowsSB->value();
+       string const str = fromqstr(
+               QString("%1 %2 %3 %4").arg(nx).arg(ny).arg(c).arg(sh));
+       dispatch(FuncRequest(LFUN_MATH_MATRIX, str));
        close();
 }