Fix bug #7511 by moving the old label instead of creating a new one.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@38671 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2011-05-09 18:56:51 +00:00
parent 0337607f59
commit c41f48411a
2 changed files with 10 additions and 6 deletions

View File

@ -884,20 +884,21 @@ void InsetMathHull::addRow(row_type row)
return; return;
bool numbered = numberedType(); 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 (type_ == hullMultline) {
if (row + 1 == nrows()) { if (row + 1 == nrows()) {
numbered_[row] = false; numbered_[row] = false;
lab = label(row); swap(label, label_[row]);
swap(number, numbers_[row]);
} else } else
numbered = false; numbered = false;
} }
numbered_.insert(numbered_.begin() + row + 1, numbered); numbered_.insert(numbered_.begin() + row + 1, numbered);
numbers_.insert(numbers_.begin() + row + 1, empty_docstring()); numbers_.insert(numbers_.begin() + row + 1, number);
label_.insert(label_.begin() + row + 1, dummy_pointer); label_.insert(label_.begin() + row + 1, label);
if (!lab.empty())
label(row + 1, lab);
InsetMathGrid::addRow(row); InsetMathGrid::addRow(row);
} }

View File

@ -71,6 +71,9 @@ What's new
- Fix crash relating to outliner and mouse movement. - Fix crash relating to outliner and mouse movement.
- Show the correct label after adding a line to an AMS Multline formula (bug
#7511).
* DOCUMENTATION AND LOCALIZATION * DOCUMENTATION AND LOCALIZATION