From: Richard Heck Date: Tue, 2 Jan 2018 03:18:52 +0000 (-0500) Subject: Fix bug #10951. X-Git-Tag: 2.2.4~34 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cc360b4899f114c6e1e434c7fd6b7808f69460a5;p=features.git Fix bug #10951. The Buffer member for the remembered definition_ was not being set. (cherry picked from commit f130f7713fae326daa05795a5bf4761d33aee649) --- diff --git a/src/mathed/MathData.h b/src/mathed/MathData.h index 0419b59181..ca2ddcf3a0 100644 --- a/src/mathed/MathData.h +++ b/src/mathed/MathData.h @@ -171,6 +171,8 @@ public: void updateMacros(Cursor * cur, MacroContext const & mc, UpdateType); /// void updateBuffer(ParIterator const &, UpdateType); + /// + void setBuffer(Buffer & b) { buffer_ = &b; } protected: /// cached values for super/subscript placement diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 06d5a2c36b..268b9989ff 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -1180,4 +1180,10 @@ void MathMacro::completionPosAndDim(Cursor const & cur, int & x, int & y, } +void MathMacro::setBuffer(Buffer & buffer) +{ + d->definition_.setBuffer(buffer); + InsetMathNest::setBuffer(buffer); +} + } // namespace lyx diff --git a/src/mathed/MathMacro.h b/src/mathed/MathMacro.h index b389e272e4..9482646d8b 100644 --- a/src/mathed/MathMacro.h +++ b/src/mathed/MathMacro.h @@ -129,6 +129,8 @@ public: size_t appetite() const; /// InsetCode lyxCode() const { return MATH_MACRO_CODE; } + /// Override so as to set Buffer for defnition_ member, too. + void setBuffer(Buffer &); protected: friend class MathData;