[LyX/2.4.x] Force a Buffer * argument to math insets constructor
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Fri Jul 5 10:34:45 UTC 2024
commit b39fb173167cbe4d5e2c72d0dcdb74adae7c26a6
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date: Wed Apr 24 15:07:15 2024 +0200
Force a Buffer * argument to math insets constructor
Make sure that math insets have a proper buffer. To this end, make the
Buffer* parameter of InsetMath mandatory and fix the compilation
errors that ensue.
(cherry picked from commit c013799887eb5c330f3cff4d51542028683fe1bb)
---
src/Cursor.cpp | 6 ++---
src/mathed/InsetMath.h | 2 +-
src/mathed/InsetMathBig.cpp | 4 ++--
src/mathed/InsetMathBig.h | 2 +-
src/mathed/InsetMathBrace.cpp | 4 ++--
src/mathed/InsetMathBrace.h | 2 +-
src/mathed/InsetMathChar.cpp | 4 ++--
src/mathed/InsetMathChar.h | 2 +-
src/mathed/InsetMathDots.cpp | 4 ++--
src/mathed/InsetMathDots.h | 2 +-
src/mathed/InsetMathExInt.cpp | 4 ++--
src/mathed/InsetMathGrid.cpp | 6 ++---
src/mathed/InsetMathHull.cpp | 2 +-
src/mathed/InsetMathKern.cpp | 11 +++++----
src/mathed/InsetMathKern.h | 6 ++---
src/mathed/InsetMathMacro.cpp | 6 +++--
src/mathed/InsetMathMacroArgument.cpp | 4 ++--
src/mathed/InsetMathMacroArgument.h | 5 ++--
src/mathed/InsetMathMacroTemplate.cpp | 43 ++++++++++++++++++-----------------
src/mathed/InsetMathNest.cpp | 36 ++++++++++++++---------------
src/mathed/InsetMathNumber.cpp | 4 ++--
src/mathed/InsetMathNumber.h | 2 +-
src/mathed/InsetMathSpace.cpp | 12 +++++-----
src/mathed/InsetMathSpace.h | 6 ++---
src/mathed/InsetMathSpecialChar.cpp | 4 ++--
src/mathed/InsetMathSpecialChar.h | 2 +-
src/mathed/InsetMathString.cpp | 4 ++--
src/mathed/InsetMathString.h | 2 +-
src/mathed/InsetMathSymbol.cpp | 12 +++++-----
src/mathed/InsetMathSymbol.h | 6 ++---
src/mathed/InsetMathUnknown.cpp | 4 ++--
src/mathed/InsetMathUnknown.h | 2 +-
src/mathed/MathData.cpp | 4 ++--
src/mathed/MathExtern.cpp | 4 ++--
src/mathed/MathFactory.cpp | 16 ++++++-------
src/mathed/MathParser.cpp | 42 +++++++++++++++++-----------------
36 files changed, 142 insertions(+), 139 deletions(-)
diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 0e1c3ded55..45ae34c4b2 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -1492,7 +1492,7 @@ void Cursor::insert(char_type c)
LASSERT(!empty(), return);
if (inMathed()) {
cap::selClearOrDel(*this);
- insert(new InsetMathChar(c));
+ insert(new InsetMathChar(buffer(), c));
} else {
text()->insertChar(*this, c);
}
@@ -1576,7 +1576,7 @@ void Cursor::niceInsert(MathAtom const & t)
docstring const name = t->asMacro()->name();
MacroData const * data = buffer()->getMacro(name);
if (data && data->numargs() - data->optionals() > 0) {
- plainInsert(MathAtom(new InsetMathBrace(ar)));
+ plainInsert(MathAtom(new InsetMathBrace(buffer(), ar)));
posBackward();
}
}
@@ -1836,7 +1836,7 @@ bool Cursor::macroModeClose(bool cancel)
// finally put the macro argument behind, if needed
if (macroArg) {
if (selection.size() > 1 || selection[0]->asScriptInset())
- plainInsert(MathAtom(new InsetMathBrace(selection)));
+ plainInsert(MathAtom(new InsetMathBrace(buffer(), selection)));
else
insert(selection);
}
diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h
index 7ea8a7cfc1..34484028bb 100644
--- a/src/mathed/InsetMath.h
+++ b/src/mathed/InsetMath.h
@@ -120,7 +120,7 @@ class ReplaceData;
class InsetMath : public Inset {
public:
///
- explicit InsetMath(Buffer * buf = 0) : Inset(buf) {}
+ explicit InsetMath(Buffer * buf) : Inset(buf) {}
/// identification as math inset
InsetMath * asInsetMath() override { return this; }
/// identification as math inset
diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp
index 4972911b75..93661e1f56 100644
--- a/src/mathed/InsetMathBig.cpp
+++ b/src/mathed/InsetMathBig.cpp
@@ -28,8 +28,8 @@
namespace lyx {
-InsetMathBig::InsetMathBig(docstring const & name, docstring const & delim)
- : name_(name), delim_(delim)
+InsetMathBig::InsetMathBig(Buffer * buf, docstring const & name, docstring const & delim)
+ : InsetMath(buf), name_(name), delim_(delim)
{}
diff --git a/src/mathed/InsetMathBig.h b/src/mathed/InsetMathBig.h
index 09f04a6f78..5f00006793 100644
--- a/src/mathed/InsetMathBig.h
+++ b/src/mathed/InsetMathBig.h
@@ -21,7 +21,7 @@ namespace lyx {
class InsetMathBig : public InsetMath {
public:
///
- InsetMathBig(docstring const & name, docstring const & delim);
+ InsetMathBig(Buffer * buf, docstring const & name, docstring const & delim);
///
docstring name() const override;
/// class is different for l(eft), r(ight) and m(iddle)
diff --git a/src/mathed/InsetMathBrace.cpp b/src/mathed/InsetMathBrace.cpp
index b98d29a7e8..db779563cd 100644
--- a/src/mathed/InsetMathBrace.cpp
+++ b/src/mathed/InsetMathBrace.cpp
@@ -32,8 +32,8 @@ InsetMathBrace::InsetMathBrace(Buffer * buf)
{}
-InsetMathBrace::InsetMathBrace(MathData const & ar)
- : InsetMathNest(const_cast<Buffer *>(ar.buffer()), 1),
+InsetMathBrace::InsetMathBrace(Buffer * buf, MathData const & ar)
+ : InsetMathNest(buf, 1),
current_mode_(UNDECIDED_MODE)
{
cell(0) = ar;
diff --git a/src/mathed/InsetMathBrace.h b/src/mathed/InsetMathBrace.h
index cde1967761..b8f924dac0 100644
--- a/src/mathed/InsetMathBrace.h
+++ b/src/mathed/InsetMathBrace.h
@@ -24,7 +24,7 @@ public:
///
explicit InsetMathBrace(Buffer * buf);
///
- explicit InsetMathBrace(MathData const & ar);
+ explicit InsetMathBrace(Buffer * buf, MathData const & ar);
/// identifies brace insets
InsetMathBrace * asBraceInset() override { return this; }
/// identifies brace insets
diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp
index a642a5e6da..199982a5f7 100644
--- a/src/mathed/InsetMathChar.cpp
+++ b/src/mathed/InsetMathChar.cpp
@@ -92,8 +92,8 @@ static bool slanted(char_type c)
}
-InsetMathChar::InsetMathChar(char_type c)
- : char_(c), kerning_(0), subst_(makeSubstitute(c))
+InsetMathChar::InsetMathChar(Buffer * buf, char_type c)
+ : InsetMath(buf), char_(c), kerning_(0), subst_(makeSubstitute(c))
{}
diff --git a/src/mathed/InsetMathChar.h b/src/mathed/InsetMathChar.h
index be38a1398b..e98f33465d 100644
--- a/src/mathed/InsetMathChar.h
+++ b/src/mathed/InsetMathChar.h
@@ -22,7 +22,7 @@ class latexkeys;
class InsetMathChar : public InsetMath {
public:
///
- explicit InsetMathChar(char_type c);
+ explicit InsetMathChar(Buffer * buf, char_type c);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
diff --git a/src/mathed/InsetMathDots.cpp b/src/mathed/InsetMathDots.cpp
index ed0db97de6..2e9a99293c 100644
--- a/src/mathed/InsetMathDots.cpp
+++ b/src/mathed/InsetMathDots.cpp
@@ -25,8 +25,8 @@
namespace lyx {
-InsetMathDots::InsetMathDots(latexkeys const * key)
- : dh_(0), key_(key)
+InsetMathDots::InsetMathDots(Buffer * buf, latexkeys const * key)
+ : InsetMath(buf), dh_(0), key_(key)
{}
diff --git a/src/mathed/InsetMathDots.h b/src/mathed/InsetMathDots.h
index 5deffe5422..6a733ecd68 100644
--- a/src/mathed/InsetMathDots.h
+++ b/src/mathed/InsetMathDots.h
@@ -23,7 +23,7 @@ class latexkeys;
class InsetMathDots : public InsetMath {
public:
///
- explicit InsetMathDots(latexkeys const * key);
+ explicit InsetMathDots(Buffer * buf, latexkeys const * key);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
diff --git a/src/mathed/InsetMathExInt.cpp b/src/mathed/InsetMathExInt.cpp
index 03f516dd83..65ef5e78df 100644
--- a/src/mathed/InsetMathExInt.cpp
+++ b/src/mathed/InsetMathExInt.cpp
@@ -129,7 +129,7 @@ void InsetMathExInt::mathmlize(MathMLStream & ms) const
// If we should decide to do so later, then we'll need to re-merge
// r32566 and r32568.
// So right now this only handles integrals.
- InsetMathSymbol sym(symbol_);
+ InsetMathSymbol sym(buffer_, symbol_);
bool const lower = !cell(2).empty();
bool const upper = !cell(3).empty();
if (lower && upper)
@@ -164,7 +164,7 @@ void InsetMathExInt::htmlize(HtmlStream & os) const
{
// At the moment, we are not extracting sums and the like for HTML.
// So right now this only handles integrals.
- InsetMathSymbol sym(symbol_);
+ InsetMathSymbol sym(buffer_, symbol_);
bool const lower = !cell(2).empty();
bool const upper = !cell(3).empty();
diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp
index 05242aca00..c775ff4943 100644
--- a/src/mathed/InsetMathGrid.cpp
+++ b/src/mathed/InsetMathGrid.cpp
@@ -1598,7 +1598,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
else {
for (unsigned int l = 0; l < grid.rowinfo_[0].lines; ++l) {
cur.cell().insert(0,
- MathAtom(new InsetMathUnknown(from_ascii("\\hline"))));
+ MathAtom(new InsetMathUnknown(buffer_, from_ascii("\\hline"))));
cur.pos()++;
}
}
@@ -1624,7 +1624,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
for (unsigned int l = 0; l < grid.rowinfo_[r].lines; ++l) {
idx_type i = index(r + startrow, 0);
cell(i).insert(0,
- MathAtom(new InsetMathUnknown(from_ascii("\\hline"))));
+ MathAtom(new InsetMathUnknown(buffer_, from_ascii("\\hline"))));
}
}
// append columns for the left over horizontal cells
@@ -1649,7 +1649,7 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd)
else {
for (unsigned int l = 0; l < grid.rowinfo_[r].lines; ++l) {
cell(i).insert(0,
- MathAtom(new InsetMathUnknown(from_ascii("\\hline"))));
+ MathAtom(new InsetMathUnknown(buffer_, from_ascii("\\hline"))));
}
}
}
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index a74678fadc..2c820b92d0 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -1793,7 +1793,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
}
MathData eq(buffer_);
- eq.push_back(MathAtom(new InsetMathChar('=')));
+ eq.push_back(MathAtom(new InsetMathChar(buffer_, '=')));
// go to first item in line
cur.idx() -= cur.idx() % ncols();
diff --git a/src/mathed/InsetMathKern.cpp b/src/mathed/InsetMathKern.cpp
index f99a210a9d..20544e60e2 100644
--- a/src/mathed/InsetMathKern.cpp
+++ b/src/mathed/InsetMathKern.cpp
@@ -22,19 +22,20 @@
namespace lyx {
-InsetMathKern::InsetMathKern()
+InsetMathKern::InsetMathKern(Buffer * buf)
+ : InsetMath(buf)
{
}
-InsetMathKern::InsetMathKern(Length const & w)
- : wid_(w)
+InsetMathKern::InsetMathKern(Buffer * buf, Length const & w)
+ : InsetMath(buf), wid_(w)
{
}
-InsetMathKern::InsetMathKern(docstring const & s)
- : wid_(to_utf8(s))
+InsetMathKern::InsetMathKern(Buffer * buf, docstring const & s)
+ : InsetMath(buf), wid_(to_utf8(s))
{
}
diff --git a/src/mathed/InsetMathKern.h b/src/mathed/InsetMathKern.h
index c562250a36..742ecfa822 100644
--- a/src/mathed/InsetMathKern.h
+++ b/src/mathed/InsetMathKern.h
@@ -26,11 +26,11 @@ namespace lyx {
class InsetMathKern : public InsetMath {
public:
///
- InsetMathKern();
+ InsetMathKern(Buffer * buf);
///
- explicit InsetMathKern(Length const & wid);
+ explicit InsetMathKern(Buffer * buf, Length const & wid);
///
- explicit InsetMathKern(docstring const & wid);
+ explicit InsetMathKern(Buffer * buf, docstring const & wid);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp
index 1732e4a6c7..03794c6632 100644
--- a/src/mathed/InsetMathMacro.cpp
+++ b/src/mathed/InsetMathMacro.cpp
@@ -59,10 +59,12 @@ class InsetArgumentProxy : public InsetMath {
public:
///
InsetArgumentProxy(InsetMathMacro * mathMacro, size_t idx)
- : mathMacro_(mathMacro), idx_(idx), def_(&mathMacro->buffer()) {}
+ : InsetMath(&mathMacro->buffer()), mathMacro_(mathMacro), idx_(idx),
+ def_(&mathMacro->buffer()) {}
///
InsetArgumentProxy(InsetMathMacro * mathMacro, size_t idx, docstring const & def)
- : mathMacro_(mathMacro), idx_(idx), def_(&mathMacro->buffer())
+ : InsetMath(&mathMacro->buffer()), mathMacro_(mathMacro), idx_(idx),
+ def_(&mathMacro->buffer())
{
asArray(def, def_);
}
diff --git a/src/mathed/InsetMathMacroArgument.cpp b/src/mathed/InsetMathMacroArgument.cpp
index 7352b3ac87..0c3e4dd97f 100644
--- a/src/mathed/InsetMathMacroArgument.cpp
+++ b/src/mathed/InsetMathMacroArgument.cpp
@@ -52,8 +52,8 @@ void InsetMathHash::normalize(NormalStream & os) const
}
-InsetMathMacroArgument::InsetMathMacroArgument(int n)
- : number_(n)
+InsetMathMacroArgument::InsetMathMacroArgument(Buffer * buf, int n)
+ : InsetMathHash(buf), number_(n)
{
if (n < 1 || n > 9) {
LYXERR0("InsetMathMacroArgument::InsetMathMacroArgument: wrong Argument id: "
diff --git a/src/mathed/InsetMathMacroArgument.h b/src/mathed/InsetMathMacroArgument.h
index c11a9a6dbb..4ca277016a 100644
--- a/src/mathed/InsetMathMacroArgument.h
+++ b/src/mathed/InsetMathMacroArgument.h
@@ -24,7 +24,8 @@ namespace lyx {
// A # that failed to parse
class InsetMathHash : public InsetMath {
public:
- explicit InsetMathHash(docstring const & str = docstring()) : str_('#' + str) {}
+ explicit InsetMathHash(Buffer * buf, docstring const & str = docstring())
+ : InsetMath(buf), str_('#' + str) {}
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
@@ -47,7 +48,7 @@ protected:
class InsetMathMacroArgument : public InsetMathHash {
public:
/// Assumes 0 < number <= 9
- explicit InsetMathMacroArgument(int number);
+ explicit InsetMathMacroArgument(Buffer * buf, int number);
///
int number() const { return number_; }
/// Assumes 0 < n <= 9
diff --git a/src/mathed/InsetMathMacroTemplate.cpp b/src/mathed/InsetMathMacroTemplate.cpp
index 94d7885469..2a2a87eb57 100644
--- a/src/mathed/InsetMathMacroTemplate.cpp
+++ b/src/mathed/InsetMathMacroTemplate.cpp
@@ -249,7 +249,8 @@ void InsetDisplayLabelBox::draw(PainterInfo & pi, int x, int y) const
class InsetMathWrapper : public InsetMath {
public:
///
- explicit InsetMathWrapper(MathData const * value) : value_(value) {}
+ explicit InsetMathWrapper(Buffer * buf, MathData const * value)
+ : InsetMath(buf), value_(value) {}
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
@@ -339,7 +340,7 @@ void InsetColoredCell::draw(PainterInfo & pi, int x, int y) const
class InsetNameWrapper : public InsetMathWrapper {
public:
///
- InsetNameWrapper(MathData const * value, InsetMathMacroTemplate const & parent);
+ InsetNameWrapper(Buffer * buf, MathData const * value, InsetMathMacroTemplate const & parent);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
@@ -353,9 +354,9 @@ private:
};
-InsetNameWrapper::InsetNameWrapper(MathData const * value,
+InsetNameWrapper::InsetNameWrapper(Buffer * buf, MathData const * value,
InsetMathMacroTemplate const & parent)
- : InsetMathWrapper(value), parent_(parent)
+ : InsetMathWrapper(buf, value), parent_(parent)
{
}
@@ -489,7 +490,7 @@ void InsetMathMacroTemplate::createLook(int args) const
look_.push_back(MathAtom(
new InsetLabelBox(buffer_, _("Name"), *this, false)));
MathData & nameData = look_[look_.size() - 1].nucleus()->cell(0);
- nameData.push_back(MathAtom(new InsetNameWrapper(&cell(0), *this)));
+ nameData.push_back(MathAtom(new InsetNameWrapper(buffer_, &cell(0), *this)));
// [#1][#2]
int i = 0;
@@ -506,44 +507,44 @@ void InsetMathMacroTemplate::createLook(int args) const
optData = &(*optData)[optData->size() - 1].nucleus()->cell(0);
}
- optData->push_back(MathAtom(new InsetMathChar('[')));
- optData->push_back(MathAtom(new InsetMathWrapper(&cell(1 + i))));
- optData->push_back(MathAtom(new InsetMathChar(']')));
+ optData->push_back(MathAtom(new InsetMathChar(buffer_, '[')));
+ optData->push_back(MathAtom(new InsetMathWrapper(buffer_, &cell(1 + i))));
+ optData->push_back(MathAtom(new InsetMathChar(buffer_, ']')));
}
}
// {#3}{#4}
for (; i < numargs_; ++i) {
- MathData arg;
- arg.push_back(MathAtom(new InsetMathMacroArgument(i + 1)));
+ MathData arg(buffer_);
+ arg.push_back(MathAtom(new InsetMathMacroArgument(buffer_, i + 1)));
if (i >= argsInLook_) {
look_.push_back(MathAtom(new InsetColoredCell(buffer_,
Color_mathmacrooldarg,
- MathAtom(new InsetMathBrace(arg)))));
+ MathAtom(new InsetMathBrace(buffer_, arg)))));
} else
- look_.push_back(MathAtom(new InsetMathBrace(arg)));
+ look_.push_back(MathAtom(new InsetMathBrace(buffer_, arg)));
}
for (; i < argsInLook_; ++i) {
MathData arg(buffer_);
- arg.push_back(MathAtom(new InsetMathMacroArgument(i + 1)));
+ arg.push_back(MathAtom(new InsetMathMacroArgument(buffer_, i + 1)));
look_.push_back(MathAtom(new InsetColoredCell(buffer_,
Color_mathmacronewarg,
- MathAtom(new InsetMathBrace(arg)))));
+ MathAtom(new InsetMathBrace(buffer_, arg)))));
}
// :=
- look_.push_back(MathAtom(new InsetMathChar(':')));
- look_.push_back(MathAtom(new InsetMathChar('=')));
+ look_.push_back(MathAtom(new InsetMathChar(buffer_, ':')));
+ look_.push_back(MathAtom(new InsetMathChar(buffer_, '=')));
// definition
look_.push_back(MathAtom(
new InsetLabelBox(buffer_, MathAtom(
- new InsetMathWrapper(&cell(defIdx()))), _("TeX"), *this, true)));
+ new InsetMathWrapper(buffer_, &cell(defIdx()))), _("TeX"), *this, true)));
// display
look_.push_back(MathAtom(
new InsetDisplayLabelBox(buffer_, MathAtom(
- new InsetMathWrapper(&cell(displayIdx()))), _("LyX"), *this)));
+ new InsetMathWrapper(buffer_, &cell(displayIdx()))), _("LyX"), *this)));
look_.setContentsBuffer();
}
@@ -716,7 +717,7 @@ void InsetMathMacroTemplate::insertMissingArguments(int maxArg)
if (found[i])
continue;
- cell(idx).push_back(MathAtom(new InsetMathMacroArgument(i + 1)));
+ cell(idx).push_back(MathAtom(new InsetMathMacroArgument(buffer_, i + 1)));
}
}
@@ -886,9 +887,9 @@ void InsetMathMacroTemplate::insertParameter(Cursor & cur,
if (addarg) {
shiftArguments(pos, 1);
- cell(defIdx()).push_back(MathAtom(new InsetMathMacroArgument(pos + 1)));
+ cell(defIdx()).push_back(MathAtom(new InsetMathMacroArgument(buffer_, pos + 1)));
if (!cell(displayIdx()).empty())
- cell(displayIdx()).push_back(MathAtom(new InsetMathMacroArgument(pos + 1)));
+ cell(displayIdx()).push_back(MathAtom(new InsetMathMacroArgument(buffer_, pos + 1)));
}
if (!greedy) {
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index b313f8bdd5..b65d224f26 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -1446,13 +1446,11 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
docstring const selection = grabAndEraseSelection(cur);
selClearOrDel(cur);
if (have_l)
- cur.insert(MathAtom(new InsetMathBig(lname,
- ldelim)));
+ cur.insert(MathAtom(new InsetMathBig(buffer_, lname, ldelim)));
// first insert the right delimiter and then go back
// and re-insert the selection (bug 7088)
if (have_r) {
- cur.insert(MathAtom(new InsetMathBig(rname,
- rdelim)));
+ cur.insert(MathAtom(new InsetMathBig(buffer_, rname, rdelim)));
cur.posBackward();
}
cur.niceInsert(selection);
@@ -1466,18 +1464,18 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
cur.recordUndoSelection();
string const name = cmd.getArg(0);
if (name == "normal")
- cur.insert(MathAtom(new InsetMathSpace(" ", "")));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_, " ", "")));
else if (name == "protected")
- cur.insert(MathAtom(new InsetMathSpace("~", "")));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_, "~", "")));
else if (name == "thin" || name == "med" || name == "thick")
- cur.insert(MathAtom(new InsetMathSpace(name + "space", "")));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_, name + "space", "")));
else if (name == "hfill*")
- cur.insert(MathAtom(new InsetMathSpace("hspace*{\\fill}", "")));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_, "hspace*{\\fill}", "")));
else if (name == "quad" || name == "qquad" ||
name == "enspace" || name == "enskip" ||
name == "negthinspace" || name == "negmedspace" ||
name == "negthickspace" || name == "hfill")
- cur.insert(MathAtom(new InsetMathSpace(name, "")));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_, name, "")));
else if (name == "hspace" || name == "hspace*") {
string const len = cmd.getArg(1);
if (len.empty() || !isValidLength(len)) {
@@ -1485,20 +1483,20 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
"needs a valid length argument." << endl;
break;
}
- cur.insert(MathAtom(new InsetMathSpace(name, len)));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_, name, len)));
} else
- cur.insert(MathAtom(new InsetMathSpace));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_)));
break;
}
case LFUN_MATH_SPACE:
cur.recordUndoSelection();
if (cmd.argument().empty())
- cur.insert(MathAtom(new InsetMathSpace));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_)));
else {
string const name = cmd.getArg(0);
string const len = cmd.getArg(1);
- cur.insert(MathAtom(new InsetMathSpace(name, len)));
+ cur.insert(MathAtom(new InsetMathSpace(buffer_, name, len)));
}
break;
@@ -2037,7 +2035,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
cur.backspace();
int n = c - '0';
if (n >= 1 && n <= 9)
- cur.insert(new InsetMathMacroArgument(n));
+ cur.insert(new InsetMathMacroArgument(buffer_, n));
return true;
}
@@ -2070,7 +2068,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
asArray(p->selection(), sel);
cur.backspace();
if (c == '{')
- cur.niceInsert(MathAtom(new InsetMathBrace(sel)));
+ cur.niceInsert(MathAtom(new InsetMathBrace(buffer_, sel)));
else
cur.niceInsert(MathAtom(new InsetMathComment(sel)));
} else if (c == '#') {
@@ -2108,7 +2106,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
--cur.pos();
cur.cell().erase(cur.pos());
cur.plainInsert(MathAtom(
- new InsetMathBig(name.substr(1), delim)));
+ new InsetMathBig(buffer_, name.substr(1), delim)));
return true;
}
} else if (name == "\\smash" && c == '[') {
@@ -2155,7 +2153,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
cur.recordUndoInset();
docstring const safe = cap::grabAndEraseSelection(cur);
if (!cur.inRegexped() && !in_macro_name)
- cur.insert(MathAtom(new InsetMathUnknown(from_ascii("\\"), safe, false)));
+ cur.insert(MathAtom(new InsetMathUnknown(buffer_, from_ascii("\\"), safe, false)));
else
cur.niceInsert(createInsetMath("backslash", buf));
}
@@ -2251,7 +2249,7 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
return true;
}
if (currentMode() == InsetMath::MATH_MODE && Encodings::isUnicodeTextOnly(c)) {
- MathAtom const atom(new InsetMathChar(c));
+ MathAtom const atom(new InsetMathChar(buffer_, c));
if (cur.prevInset() && cur.prevInset()->asInsetMath()->name() == "text") {
// reuse existing \text inset
cur.prevInset()->asInsetMath()->cell(0).push_back(atom);
@@ -2309,7 +2307,7 @@ bool InsetMathNest::interpretString(Cursor & cur, docstring const & str)
if (l && l->inset == "big") {
cur.recordUndoSelection();
cur.cell()[cur.pos() - 1] =
- MathAtom(new InsetMathBig(prev, str));
+ MathAtom(new InsetMathBig(buffer_, prev, str));
return true;
}
}
diff --git a/src/mathed/InsetMathNumber.cpp b/src/mathed/InsetMathNumber.cpp
index 2ce14a7875..e1b3f5082e 100644
--- a/src/mathed/InsetMathNumber.cpp
+++ b/src/mathed/InsetMathNumber.cpp
@@ -21,8 +21,8 @@ using namespace std;
namespace lyx {
-InsetMathNumber::InsetMathNumber(docstring const & s)
- : str_(s)
+InsetMathNumber::InsetMathNumber(Buffer * buf, docstring const & s)
+ : InsetMath(buf), str_(s)
{}
diff --git a/src/mathed/InsetMathNumber.h b/src/mathed/InsetMathNumber.h
index 1b1f059bc0..99e8c3c70b 100644
--- a/src/mathed/InsetMathNumber.h
+++ b/src/mathed/InsetMathNumber.h
@@ -24,7 +24,7 @@ namespace lyx {
class InsetMathNumber : public InsetMath {
public:
///
- explicit InsetMathNumber(docstring const & s);
+ explicit InsetMathNumber(Buffer * buf, docstring const & s);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp
index b5f03881bf..b0b2dfec3b 100644
--- a/src/mathed/InsetMathSpace.cpp
+++ b/src/mathed/InsetMathSpace.cpp
@@ -77,14 +77,14 @@ int const defaultSpace = 4;
} // namespace
-InsetMathSpace::InsetMathSpace()
- : space_(defaultSpace)
+InsetMathSpace::InsetMathSpace(Buffer * buf)
+ : InsetMath(buf), space_(defaultSpace)
{
}
-InsetMathSpace::InsetMathSpace(string const & name, string const & length)
- : space_(defaultSpace)
+InsetMathSpace::InsetMathSpace(Buffer * buf, string const & name, string const & length)
+ : InsetMath(buf), space_(defaultSpace)
{
for (int i = 0; i < nSpace; ++i)
if (space_info[i].name == name) {
@@ -101,8 +101,8 @@ InsetMathSpace::InsetMathSpace(string const & name, string const & length)
}
-InsetMathSpace::InsetMathSpace(Length const & length, bool const prot)
- : space_(defaultSpace), length_(length)
+InsetMathSpace::InsetMathSpace(Buffer * buf, Length const & length, bool const prot)
+ : InsetMath(buf), space_(defaultSpace), length_(length)
{
for (int i = 0; i < nSpace; ++i)
if ((prot && space_info[i].name == "hspace*")
diff --git a/src/mathed/InsetMathSpace.h b/src/mathed/InsetMathSpace.h
index 96121726b6..bbccd36654 100644
--- a/src/mathed/InsetMathSpace.h
+++ b/src/mathed/InsetMathSpace.h
@@ -25,11 +25,11 @@ struct InsetSpaceParams;
class InsetMathSpace : public InsetMath {
public:
///
- explicit InsetMathSpace();
+ explicit InsetMathSpace(Buffer * buf);
///
- explicit InsetMathSpace(std::string const & name, std::string const & length);
+ explicit InsetMathSpace(Buffer * buf, std::string const & name, std::string const & length);
///
- explicit InsetMathSpace(Length const & length, bool const prot = false);
+ explicit InsetMathSpace(Buffer * buf, Length const & length, bool const prot = false);
///
InsetMathSpace const * asSpaceInset() const override { return this; }
///
diff --git a/src/mathed/InsetMathSpecialChar.cpp b/src/mathed/InsetMathSpecialChar.cpp
index 3fc796f834..746cec5bda 100644
--- a/src/mathed/InsetMathSpecialChar.cpp
+++ b/src/mathed/InsetMathSpecialChar.cpp
@@ -29,8 +29,8 @@
namespace lyx {
-InsetMathSpecialChar::InsetMathSpecialChar(docstring const & name)
- : name_(name), kerning_(0)
+InsetMathSpecialChar::InsetMathSpecialChar(Buffer * buf, docstring const & name)
+ : InsetMath(buf), name_(name), kerning_(0)
{
if (name.size() != 1) {
if (name == "textasciicircum" || name == "mathcircumflex")
diff --git a/src/mathed/InsetMathSpecialChar.h b/src/mathed/InsetMathSpecialChar.h
index d46e3456d7..9abd6b30ad 100644
--- a/src/mathed/InsetMathSpecialChar.h
+++ b/src/mathed/InsetMathSpecialChar.h
@@ -23,7 +23,7 @@ class InsetMathSpecialChar : public InsetMath
{
public:
///
- explicit InsetMathSpecialChar(docstring const & name);
+ explicit InsetMathSpecialChar(Buffer * buf, docstring const & name);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
diff --git a/src/mathed/InsetMathString.cpp b/src/mathed/InsetMathString.cpp
index 2a80e546be..f7e86d11bf 100644
--- a/src/mathed/InsetMathString.cpp
+++ b/src/mathed/InsetMathString.cpp
@@ -31,8 +31,8 @@ using lyx::support::escape;
namespace lyx {
-InsetMathString::InsetMathString(docstring const & s)
- : str_(s)
+InsetMathString::InsetMathString(Buffer * buf, docstring const & s)
+ : InsetMath(buf), str_(s)
{}
diff --git a/src/mathed/InsetMathString.h b/src/mathed/InsetMathString.h
index 02ce7f039c..6112b2546b 100644
--- a/src/mathed/InsetMathString.h
+++ b/src/mathed/InsetMathString.h
@@ -26,7 +26,7 @@ namespace lyx {
class InsetMathString : public InsetMath {
public:
///
- explicit InsetMathString(docstring const & s);
+ explicit InsetMathString(Buffer * buf, docstring const & s);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp
index a978deb028..14e84fdfd2 100644
--- a/src/mathed/InsetMathSymbol.cpp
+++ b/src/mathed/InsetMathSymbol.cpp
@@ -30,18 +30,18 @@ using namespace std;
namespace lyx {
-InsetMathSymbol::InsetMathSymbol(latexkeys const * l)
- : sym_(l)
+InsetMathSymbol::InsetMathSymbol(Buffer * buf, latexkeys const * l)
+ : InsetMath(buf), sym_(l)
{}
-InsetMathSymbol::InsetMathSymbol(char const * name)
- : sym_(in_word_set(from_ascii(name)))
+InsetMathSymbol::InsetMathSymbol(Buffer * buf, char const * name)
+ : InsetMath(buf), sym_(in_word_set(from_ascii(name)))
{}
-InsetMathSymbol::InsetMathSymbol(docstring const & name)
- : sym_(in_word_set(name))
+InsetMathSymbol::InsetMathSymbol(Buffer * buf, docstring const & name)
+ : InsetMath(buf), sym_(in_word_set(name))
{}
diff --git a/src/mathed/InsetMathSymbol.h b/src/mathed/InsetMathSymbol.h
index f894782ab5..735890ecba 100644
--- a/src/mathed/InsetMathSymbol.h
+++ b/src/mathed/InsetMathSymbol.h
@@ -23,11 +23,11 @@ class latexkeys;
class InsetMathSymbol : public InsetMath {
public:
///
- explicit InsetMathSymbol(latexkeys const * l);
+ explicit InsetMathSymbol(Buffer * buf, latexkeys const * l);
///
- explicit InsetMathSymbol(char const * name);
+ explicit InsetMathSymbol(Buffer * buf, char const * name);
///
- explicit InsetMathSymbol(docstring const & name);
+ explicit InsetMathSymbol(Buffer * buf, docstring const & name);
///
void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
diff --git a/src/mathed/InsetMathUnknown.cpp b/src/mathed/InsetMathUnknown.cpp
index 92d6b416e1..4b215cfa45 100644
--- a/src/mathed/InsetMathUnknown.cpp
+++ b/src/mathed/InsetMathUnknown.cpp
@@ -23,9 +23,9 @@
namespace lyx {
-InsetMathUnknown::InsetMathUnknown(docstring const & name,
+InsetMathUnknown::InsetMathUnknown(Buffer * buf, docstring const & name,
docstring const & selection, bool final, bool black)
- : name_(name), final_(final), black_(black), kerning_(0),
+ : InsetMath(buf), name_(name), final_(final), black_(black), kerning_(0),
selection_(selection)
{}
diff --git a/src/mathed/InsetMathUnknown.h b/src/mathed/InsetMathUnknown.h
index f0377168fa..a6efb161e0 100644
--- a/src/mathed/InsetMathUnknown.h
+++ b/src/mathed/InsetMathUnknown.h
@@ -21,7 +21,7 @@ namespace lyx {
class InsetMathUnknown : public InsetMath {
public:
///
- explicit InsetMathUnknown(docstring const & name,
+ explicit InsetMathUnknown(Buffer * buf, docstring const & name,
docstring const & selection = empty_docstring(),
bool final = true, bool black = false);
///
diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
index 67e80709da..73c1d9db90 100644
--- a/src/mathed/MathData.cpp
+++ b/src/mathed/MathData.cpp
@@ -647,7 +647,7 @@ void MathData::detachMacroParameters(DocIterator * cur, const size_type macroPos
&& !(arg[0]->asMacro() && arg[0]->asMacro()->arity() > 0))
insert(p, arg[0]);
else
- insert(p, MathAtom(new InsetMathBrace(arg)));
+ insert(p, MathAtom(new InsetMathBrace(buffer_, arg)));
// cursor in macro?
if (curMacroSlice == -1)
@@ -713,7 +713,7 @@ void MathData::attachMacroParameters(Cursor * cur,
if (scriptInset->nuc().empty()) {
MathData ar(buffer_);
scriptInset->nuc().push_back(
- MathAtom(new InsetMathBrace(ar)));
+ MathAtom(new InsetMathBrace(buffer_, ar)));
}
// put macro into a script inset
scriptInset->nuc()[0] = operator[](macroPos);
diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp
index 0f7ad7cb0e..1f9356f8f2 100644
--- a/src/mathed/MathExtern.cpp
+++ b/src/mathed/MathExtern.cpp
@@ -191,7 +191,7 @@ void extractStrings(MathData & ar)
if (!ar[i]->asCharInset())
continue;
docstring s = charSequence(ar.begin() + i, ar.end());
- ar[i] = MathAtom(new InsetMathString(s));
+ ar[i] = MathAtom(new InsetMathString(ar.buffer(), s));
ar.erase(i + 1, i + s.size());
}
//lyxerr << "\nStrings to: " << ar << endl;
@@ -486,7 +486,7 @@ void extractNumbers(MathData & ar)
docstring s = digitSequence(ar.begin() + i, ar.end());
- ar[i] = MathAtom(new InsetMathNumber(s));
+ ar[i] = MathAtom(new InsetMathNumber(ar.buffer(), s));
ar.erase(i + 1, i + s.size());
}
//lyxerr << "\nNumbers to: " << ar << endl;
diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp
index 299cf00c05..2a25d8464a 100644
--- a/src/mathed/MathFactory.cpp
+++ b/src/mathed/MathFactory.cpp
@@ -474,11 +474,11 @@ MathAtom createInsetMath(docstring const & s, Buffer * buf)
if (inset == "decoration")
return MathAtom(new InsetMathDecoration(buf, l));
if (inset == "space")
- return MathAtom(new InsetMathSpace(to_ascii(l->name), ""));
+ return MathAtom(new InsetMathSpace(buf, to_ascii(l->name), ""));
if (inset == "class")
return MathAtom(new InsetMathClass(buf, string_to_class(s)));
if (inset == "dots")
- return MathAtom(new InsetMathDots(l));
+ return MathAtom(new InsetMathDots(buf, l));
if (inset == "mbox")
return MathAtom(new InsetMathBox(buf, l->name));
// if (inset == "fbox")
@@ -498,15 +498,15 @@ MathAtom createInsetMath(docstring const & s, Buffer * buf)
if (inset == "big")
// we can't create a InsetMathBig, since the argument
// is missing.
- return MathAtom(new InsetMathUnknown(s));
- return MathAtom(new InsetMathSymbol(l));
+ return MathAtom(new InsetMathUnknown(buf, s));
+ return MathAtom(new InsetMathSymbol(buf, l));
}
if (s.size() == 2 && s[0] == '#' && s[1] >= '1' && s[1] <= '9')
- return MathAtom(new InsetMathMacroArgument(s[1] - '0'));
+ return MathAtom(new InsetMathMacroArgument(buf, s[1] - '0'));
if (s.size() == 3 && s[0] == '\\' && s[1] == '#'
&& s[2] >= '1' && s[2] <= '9')
- return MathAtom(new InsetMathMacroArgument(s[2] - '0'));
+ return MathAtom(new InsetMathMacroArgument(buf, s[2] - '0'));
if (s == "boxed")
return MathAtom(new InsetMathBoxed(buf));
if (s == "fbox")
@@ -680,9 +680,9 @@ MathAtom createInsetMath(docstring const & s, Buffer * buf)
if (s == "sidesetn")
return MathAtom(new InsetMathSideset(buf, false, false));
if (isSpecialChar(s))
- return MathAtom(new InsetMathSpecialChar(s));
+ return MathAtom(new InsetMathSpecialChar(buf, s));
if (s == " ")
- return MathAtom(new InsetMathSpace(" ", ""));
+ return MathAtom(new InsetMathSpace(buf, " ", ""));
if (s == "regexp")
return MathAtom(new InsetMathHull(buf, hullRegexp));
diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp
index a7791d1482..79e0ec003d 100644
--- a/src/mathed/MathParser.cpp
+++ b/src/mathed/MathParser.cpp
@@ -916,30 +916,30 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
}
else if (t.cat() == catLetter)
- cell->push_back(MathAtom(new InsetMathChar(t.character())));
+ cell->push_back(MathAtom(new InsetMathChar(buf, t.character())));
else if (t.cat() == catSpace && mode != InsetMath::MATH_MODE) {
if (cell->empty() || cell->back()->getChar() != ' ')
- cell->push_back(MathAtom(new InsetMathChar(t.character())));
+ cell->push_back(MathAtom(new InsetMathChar(buf, t.character())));
}
else if (t.cat() == catNewline && mode != InsetMath::MATH_MODE) {
if (cell->empty() || cell->back()->getChar() != ' ')
- cell->push_back(MathAtom(new InsetMathChar(' ')));
+ cell->push_back(MathAtom(new InsetMathChar(buf, ' ')));
}
else if (t.cat() == catParameter) {
Token const & n = nextToken();
char_type c = n.character();
if (c && '0' < c && c <= '9') {
- cell->push_back(MathAtom(new InsetMathMacroArgument(c - '0')));
+ cell->push_back(MathAtom(new InsetMathMacroArgument(buf, c - '0')));
getToken();
} else
- cell->push_back(MathAtom(new InsetMathHash()));
+ cell->push_back(MathAtom(new InsetMathHash(buf)));
}
else if (t.cat() == catActive)
- cell->push_back(MathAtom(new InsetMathSpace(string(1, t.character()), "")));
+ cell->push_back(MathAtom(new InsetMathSpace(buf, string(1, t.character()), "")));
else if (t.cat() == catBegin) {
MathData ar(buf);
@@ -949,7 +949,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
if (ar.size() == 1 && ar[0]->extraBraces())
cell->append(ar);
else
- cell->push_back(MathAtom(new InsetMathBrace(ar)));
+ cell->push_back(MathAtom(new InsetMathBrace(buf, ar)));
}
else if (t.cat() == catEnd) {
@@ -1017,14 +1017,14 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
|| mode_ & Parse::VERBATIM
|| !(mode_ & Parse::USETEXT)
|| mode == InsetMath::TEXT_MODE) {
- cell->push_back(MathAtom(new InsetMathChar(c)));
+ cell->push_back(MathAtom(new InsetMathChar(buf, c)));
} else {
MathAtom at = createInsetMath("text", buf);
- at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
+ at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(buf, c)));
while (nextToken().cat() == catOther
&& Encodings::isUnicodeTextOnly(nextToken().character())) {
c = getToken().character();
- at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
+ at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(buf, c)));
}
cell->push_back(at);
}
@@ -1397,7 +1397,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
} else {
MathAtom at = MathAtom(new InsetMathMacro(buf, t.cs()));
cell->push_back(at);
- cell->push_back(MathAtom(new InsetMathBrace(count)));
+ cell->push_back(MathAtom(new InsetMathBrace(buf, count)));
}
}
@@ -1553,10 +1553,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
docstring const ref = parse_verbatim_item();
if (!opt.empty()) {
cell->back().nucleus()->cell(1).push_back(
- MathAtom(new InsetMathString(opt)));
+ MathAtom(new InsetMathString(buf, opt)));
}
cell->back().nucleus()->cell(0).push_back(
- MathAtom(new InsetMathString(ref)));
+ MathAtom(new InsetMathString(buf, ref)));
}
else if (t.cs() == "left") {
@@ -1784,7 +1784,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
if (s.empty())
cell->push_back(MathAtom(new InsetMathMacro(buf, t.cs())));
else
- cell->push_back(MathAtom(new InsetMathKern(s)));
+ cell->push_back(MathAtom(new InsetMathKern(buf, s)));
}
else if (t.cs() == "label") {
@@ -1796,7 +1796,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
grid.asHullInset()->label(cellrow, label);
} else {
cell->push_back(createInsetMath(t.cs(), buf));
- cell->push_back(MathAtom(new InsetMathBrace(ar)));
+ cell->push_back(MathAtom(new InsetMathBrace(buf, ar)));
}
}
@@ -1885,9 +1885,9 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
docstring const arg = parse_verbatim_item();
Length length;
if (prot && arg == "\\fill")
- cell->push_back(MathAtom(new InsetMathSpace("hspace*{\\fill}", "")));
+ cell->push_back(MathAtom(new InsetMathSpace(buf, "hspace*{\\fill}", "")));
else if (isValidLength(to_utf8(arg), &length))
- cell->push_back(MathAtom(new InsetMathSpace(length, prot)));
+ cell->push_back(MathAtom(new InsetMathSpace(buf, length, prot)));
else {
// Since the Length class cannot use length variables
// we must not create an InsetMathSpace.
@@ -1962,10 +1962,10 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
Encodings::MATH_CMD | Encodings::TEXT_CMD,
termination, rem);
for (char_type c : cmd)
- cell->push_back(MathAtom(new InsetMathChar(c)));
+ cell->push_back(MathAtom(new InsetMathChar(buf, c)));
if (!rem.empty()) {
char_type c = rem[0];
- cell->push_back(MathAtom(new InsetMathChar(c)));
+ cell->push_back(MathAtom(new InsetMathChar(buf, c)));
cmd = rem.substr(1);
rem.clear();
} else
@@ -1991,7 +1991,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
docstring const delim = getToken().asInput();
if (InsetMathBig::isBigInsetDelim(delim))
cell->push_back(MathAtom(
- new InsetMathBig(t.cs(), delim)));
+ new InsetMathBig(buf, t.cs(), delim)));
else {
cell->push_back(createInsetMath(t.cs(), buf));
// For some reason delim.empty()
@@ -2091,7 +2091,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
}
}
is_unicode_symbol = true;
- cell->push_back(MathAtom(new InsetMathChar(c)));
+ cell->push_back(MathAtom(new InsetMathChar(buf, c)));
} else {
while (num_tokens--)
putback();
More information about the lyx-cvs
mailing list