From a7795cf303979ca0984a5cdb097e65e280d949c5 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sat, 22 May 2010 17:15:57 +0000 Subject: [PATCH] Correctly restore a dissolved macro inset on undo (bug #6678). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@34454 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Undo.cpp | 3 ++- src/mathed/MathData.cpp | 4 +++- status.16x | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Undo.cpp b/src/Undo.cpp index c7684bb1fc..399baa0df0 100644 --- a/src/Undo.cpp +++ b/src/Undo.cpp @@ -296,7 +296,8 @@ void Undo::Private::doRecordUndo(UndoKind kind, // fill in the real data to be saved if (cell.inMathed()) { // 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 { // some more effort needed here as 'the whole cell' of the // main Text _is_ the whole document. diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index 442ecceb8c..c7f8544eb0 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -391,7 +391,9 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc) if (!macroInset || macroInset->name_.empty() || macroInset->name_[0] == '^' || macroInset->name_[0] == '_' - || macroInset->name() == edited_name) + || (macroInset->name() == edited_name + && macroInset->displayMode() == + MathMacro::DISPLAY_UNFOLDED)) continue; // get macro diff --git a/status.16x b/status.16x index 149cb86694..68c18f3886 100644 --- a/status.16x +++ b/status.16x @@ -60,6 +60,7 @@ What's new * USER INTERFACE +- Correctly restore a dissolved macro inset on undo (bug 6678). * DOCUMENTATION AND LOCALIZATION