]> git.lyx.org Git - features.git/commitdiff
Fix bug #10951.
authorRichard Heck <rgheck@lyx.org>
Tue, 2 Jan 2018 03:18:52 +0000 (22:18 -0500)
committerRichard Heck <rgheck@lyx.org>
Thu, 4 Jan 2018 20:39:38 +0000 (15:39 -0500)
The Buffer member for the remembered definition_ was not being set.

(cherry picked from commit f130f7713fae326daa05795a5bf4761d33aee649)

src/mathed/MathData.h
src/mathed/MathMacro.cpp
src/mathed/MathMacro.h

index 0419b5918168b3397c55c2d2f134f21e17bedd93..ca2ddcf3a0e87a4925ee4ebcad76a90b0c8912bd 100644 (file)
@@ -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
index 06d5a2c36b8b7aa129813781ac2ff9751322b79c..268b9989ffa431e0eef605dbdc95e805150fda93 100644 (file)
@@ -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
index b389e272e4b2f3aa4ff3bad1799c19876f4d03ef..9482646d8ba6af6c453c3114ccbf934de6dd778c 100644 (file)
@@ -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;