]> git.lyx.org Git - features.git/commitdiff
Move code to more proper place.
authorEnrico Forestieri <forenr@lyx.org>
Thu, 19 Aug 2010 22:50:06 +0000 (22:50 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 19 Aug 2010 22:50:06 +0000 (22:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35180 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathHull.cpp

index 930f848a30a8262a49bebbffa336bab68498f204..bf3d0f97897b43b02a3d2c2b9a43d5f5b8471800 100644 (file)
@@ -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.