]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #7511 by moving the old label instead of creating a new one.
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 8 May 2011 11:19:55 +0000 (11:19 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 8 May 2011 11:19:55 +0000 (11:19 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38640 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathHull.cpp

index 686e4274077c61251d66d4ec7e6ffb242cfa0789..308ea599eee55ce23ddf817c72ffadb2a77e8e9f 100644 (file)
@@ -884,20 +884,21 @@ void InsetMathHull::addRow(row_type row)
                return;
 
        bool numbered = numberedType();
-       docstring lab;
+       // Move the number and raw pointer, do not call label() (bug 7511)
+       InsetLabel * label = dummy_pointer;
+       docstring number = empty_docstring();
        if (type_ == hullMultline) {
                if (row + 1 == nrows())  {
                        numbered_[row] = false;
-                       lab = label(row);
+                       swap(label, label_[row]);
+                       swap(number, numbers_[row]);
                } else
                        numbered = false;
        }
 
        numbered_.insert(numbered_.begin() + row + 1, numbered);
-       numbers_.insert(numbers_.begin() + row + 1, empty_docstring());
-       label_.insert(label_.begin() + row + 1, dummy_pointer);
-       if (!lab.empty())
-               label(row + 1, lab);
+       numbers_.insert(numbers_.begin() + row + 1, number);
+       label_.insert(label_.begin() + row + 1, label);
        InsetMathGrid::addRow(row);
 }