From: Enrico Forestieri Date: Thu, 19 Aug 2010 22:50:06 +0000 (+0000) Subject: Move code to more proper place. X-Git-Tag: 2.0.0~2770 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7238d40c992390c5312e474c889ac1f55b251e66;p=features.git Move code to more proper place. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35180 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 930f848a30..bf3d0f9789 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -904,9 +904,14 @@ void InsetMathHull::glueall(HullType type) ar.append(cell(i)); InsetLabel * label = 0; if (type == hullEquation) { - // preserve the label - label = label_[0]; - label_[0] = 0; + // preserve first non-empty label + for (row_type row = 0; row < nrows(); ++row) { + if (label_[row]) { + label = label_[row]; + label_[row] = 0; + break; + } + } } *this = InsetMathHull(buffer_, hullSimple); if (label) @@ -1046,16 +1051,6 @@ void InsetMathHull::mutate(HullType newtype) else if (type_ == hullEqnArray) { if (newtype < type_) { - // set first non-empty label - for (row_type row = 0; row < nrows(); ++row) { - if (label_[row]) { - if (row > 0) { - label_[0] = label_[row]; - label_[row] = 0; - } - break; - } - } glueall(newtype); mutate(newtype); } else { // align & Co.