From 6852e976b08da843b06159e8ff3281a387653159 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Wed, 8 Jul 2009 01:48:19 +0000 Subject: [PATCH] Proper fix for bug #5923 that doesn't introduce bug #6015. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30410 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/MathData.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index 9b3ac80578..ac74cca64a 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -385,6 +385,19 @@ void MathData::updateMacros(Cursor * cur, MacroContext const & mc) if (!macroInset || macroInset->name_[0] == '^' || macroInset->name_[0] == '_') continue; + + if (macroInset->displayMode() == MathMacro::DISPLAY_UNFOLDED) { + docstring const & unfolded_name = macroInset->name(); + if (unfolded_name != macroInset->name_) { + // macro name was changed + cur->recordUndoInset(); + cur->leaveInset(*macroInset); + cur->plainErase(); + cur->insert(MathAtom(new InsetMathUnknown('\\' + + unfolded_name, docstring(), false))); + continue; + } + } // get macro macroInset->updateMacro(mc); -- 2.39.5