From 7238d40c992390c5312e474c889ac1f55b251e66 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Thu, 19 Aug 2010 22:50:06 +0000 Subject: [PATCH] Move code to more proper place. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35180 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathHull.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) 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. -- 2.39.2