X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt%2FGuiMathMatrix.cpp;h=db062781f0cea86389c48a81134c0ee0b9a1da10;hb=ceb03b1815583a7daf6166562f6d928d7d38b356;hp=b7719319d8be44d59a6e2538761e3329a1727931;hpb=c293be56bd12c5dc46e5cedd2828e33918fccef7;p=lyx.git diff --git a/src/frontends/qt/GuiMathMatrix.cpp b/src/frontends/qt/GuiMathMatrix.cpp index b7719319d8..db062781f0 100644 --- a/src/frontends/qt/GuiMathMatrix.cpp +++ b/src/frontends/qt/GuiMathMatrix.cpp @@ -101,7 +101,7 @@ GuiMathMatrix::GuiMathMatrix(GuiView & lv) void GuiMathMatrix::columnsChanged(int) { - int const nx = int(columnsSB->value()); + int const nx = columnsSB->value(); halignED->setText(QString(nx, 'c')); } @@ -144,7 +144,7 @@ void GuiMathMatrix::slotOK() int const ny = rowsSB->value(); // a matrix without a decoration is an array, // otherwise it is an AMS matrix - // decorated matrices cannot have a vertical alignment + // decorated matrices cannot have a vertical alignment or line char const c = v_align_c[valignCO->currentIndex()]; QString const sh = halignED->text(); @@ -154,11 +154,12 @@ void GuiMathMatrix::slotOK() if (decorationCO->currentIndex() != 0) { int const deco = decorationCO->currentIndex(); QString deco_name = DecoNames[deco - 1]; - // only if a special alignment is set create a 1x1 AMS array in which - // a normal array will be created, otherwise create just a normal AMS array - if (sh.contains('l') || sh.contains('r')) { + // if a vertical line or a special alignment is requested, + // create a 1x1 AMS matrix containing a normal array, + // otherwise create just a standard AMS matrix + if (sh.contains('l') || sh.contains('r') || sh.contains('|')) { string const str_ams = fromqstr( - QString("%1 %2 %3").arg(int(1)).arg(int(1)).arg(deco_name)); + QString("%1 %2 %3").arg(1).arg(1).arg(deco_name)); dispatch(FuncRequest(LFUN_MATH_AMS_MATRIX, str_ams)); } else { string const str_ams = fromqstr( @@ -180,9 +181,6 @@ void GuiMathMatrix::slotClose() } -Dialog * createGuiMathMatrix(GuiView & lv) { return new GuiMathMatrix(lv); } - - } // namespace frontend } // namespace lyx