From 20ae33cb2a31cd79ccaab684dfbf70c733745e57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 6 Oct 2003 09:57:03 +0000 Subject: [PATCH] make 'swap row' swap labels, too. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7859 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_charinset.C | 4 +++- src/mathed/math_gridinset.C | 2 +- src/mathed/math_hullinset.C | 13 ++++++++++++- src/mathed/math_hullinset.h | 2 ++ src/mathed/math_support.C | 10 ++++------ 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/mathed/math_charinset.C b/src/mathed/math_charinset.C index b8aa90f030..5026340031 100644 --- a/src/mathed/math_charinset.C +++ b/src/mathed/math_charinset.C @@ -12,9 +12,11 @@ #include #include "math_charinset.h" -#include "dimension.h" #include "math_support.h" #include "math_mathmlstream.h" + +#include "debug.h" +#include "dimension.h" #include "textpainter.h" using std::auto_ptr; diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 1b9e34db05..04435c235a 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -1169,7 +1169,7 @@ dispatch_result MathGridInset::dispatch for (row_type r = 0; r < numrows; ++r) { for (col_type c = 0; c < numcols; ++c) { idx_type i = index(r + row(idx), c + col(idx)); - cell(i).append(grid.cell(grid.index(r, c))); + cell(i).insert(0, grid.cell(grid.index(r, c))); } // append the left over horizontal cells to the last column idx_type i = index(r + row(idx), ncols() - 1); diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index 05427f6554..5c376e051c 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -175,7 +175,6 @@ char const * MathHullInset::standardFont() const { if (type_ == "none") return "lyxnochange"; - lyxerr << "standard font: mathnormal\n"; return "mathnormal"; } @@ -433,6 +432,18 @@ void MathHullInset::addRow(row_type row) } +void MathHullInset::swapRow(row_type row) +{ + if (nrows() == 1) + return; + if (row + 1 == nrows()) + --row; + std::swap(nonum_[row], nonum_[row + 1]); + std::swap(label_[row], label_[row + 1]); + MathGridInset::swapRow(row); +} + + void MathHullInset::delRow(row_type row) { if (nrows() <= 1) diff --git a/src/mathed/math_hullinset.h b/src/mathed/math_hullinset.h index 4de81929c1..22b108da33 100644 --- a/src/mathed/math_hullinset.h +++ b/src/mathed/math_hullinset.h @@ -66,6 +66,8 @@ public: void addRow(row_type row); /// delete a row void delRow(row_type row); + /// + void swapRow(row_type row); /// add a column void addCol(col_type col); /// delete a column diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index b1844f1c30..e8291db742 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -533,7 +533,7 @@ LyXFont::FONT_SHAPE const inh_shape = LyXFont::INHERIT_SHAPE; // does not work fontinfo fontinfos[] = { // math fonts - {"mathnormal", inh_family, LyXFont::MEDIUM_SERIES, + {"mathnormal", LyXFont::ROMAN_FAMILY, LyXFont::MEDIUM_SERIES, LyXFont::ITALIC_SHAPE, LColor::math}, {"mathbf", inh_family, LyXFont::BOLD_SERIES, inh_shape, LColor::math}, @@ -542,7 +542,7 @@ fontinfo fontinfos[] = { {"mathfrak", LyXFont::EUFRAK_FAMILY, inh_series, inh_shape, LColor::math}, {"mathrm", LyXFont::ROMAN_FAMILY, inh_series, - inh_shape, LColor::math}, + LyXFont::UP_SHAPE, LColor::math}, {"mathsf", LyXFont::SANS_FAMILY, inh_series, inh_shape, LColor::math}, {"mathbb", LyXFont::MSB_FAMILY, inh_series, @@ -598,15 +598,13 @@ fontinfo fontinfos[] = { // LyX internal usage {"lyxtex", inh_family, inh_series, - inh_shape, LColor::latex}, + LyXFont::UP_SHAPE, LColor::latex}, {"lyxert", LyXFont::TYPEWRITER_FAMILY, inh_series, - inh_shape, LColor::latex}, + LyXFont::UP_SHAPE, LColor::latex}, {"lyxsymbol", LyXFont::SYMBOL_FAMILY, inh_series, inh_shape, LColor::math}, {"lyxboldsymbol", LyXFont::SYMBOL_FAMILY, LyXFont::BOLD_SERIES, inh_shape, LColor::math}, - {"lyxitsymbol", LyXFont::SYMBOL_FAMILY, inh_series, - LyXFont::ITALIC_SHAPE, LColor::math}, {"lyxblacktext", LyXFont::ROMAN_FAMILY, LyXFont::MEDIUM_SERIES, LyXFont::UP_SHAPE, LColor::foreground}, {"lyxnochange", inh_family, inh_series, -- 2.39.2