Fix bug #6678: Crash when undoing backspace inside math-macro

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34370 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2010-05-04 16:16:20 +00:00
parent b269eb9117
commit cf1f59dd4d
2 changed files with 5 additions and 2 deletions

View File

@ -296,7 +296,8 @@ void Undo::Private::doRecordUndo(UndoKind kind,
// fill in the real data to be saved // fill in the real data to be saved
if (cell.inMathed()) { if (cell.inMathed()) {
// simply use the whole cell // simply use the whole cell
undo.array = new MathData(cell.cell()); MathData & ar = cell.cell();
undo.array = new MathData(ar.buffer(), ar.begin(), ar.end());
} else { } else {
// some more effort needed here as 'the whole cell' of the // some more effort needed here as 'the whole cell' of the
// main Text _is_ the whole document. // main Text _is_ the whole document.

View File

@ -401,7 +401,9 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc)
if (!macroInset || macroInset->name_.empty() if (!macroInset || macroInset->name_.empty()
|| macroInset->name_[0] == '^' || macroInset->name_[0] == '^'
|| macroInset->name_[0] == '_' || macroInset->name_[0] == '_'
|| macroInset->name() == edited_name) || (macroInset->name() == edited_name
&& macroInset->displayMode() ==
MathMacro::DISPLAY_UNFOLDED))
continue; continue;
// get macro // get macro