}
-void InsetFormula::write(ostream & os) const
+void InsetFormula::write(Buffer const * buf, ostream & os) const
{
os << "Formula ";
- latex(os, false, false);
+ latex(buf, os, false, false);
}
-int InsetFormula::latex(ostream & os, bool fragile, bool) const
+int InsetFormula::latex(Buffer const *, ostream & os, bool fragile, bool) const
{
par_->write(os, fragile);
return 1;
}
-int InsetFormula::ascii(ostream & os, int) const
+int InsetFormula::ascii(Buffer const *, ostream & os, int) const
{
par_->write(os, false);
return 1;
}
-int InsetFormula::linuxdoc(ostream & os) const
+int InsetFormula::linuxdoc(Buffer const * buf, ostream & os) const
{
- return ascii(os, 0);
+ return ascii(buf, os, 0);
}
-int InsetFormula::docbook(ostream & os) const
+int InsetFormula::docbook(Buffer const * buf, ostream & os) const
{
- return ascii(os, 0);
+ return ascii(buf, os, 0);
}
-void InsetFormula::read(LyXLex & lex)
+void InsetFormula::read(Buffer const *, LyXLex & lex)
{
par(mathed_parse_normal(lex));
metrics();
void metrics() const;
///
- void write(std::ostream &) const;
+ void write(Buffer const *, std::ostream &) const;
///
- void read(LyXLex & lex);
+ void read(Buffer const *, LyXLex & lex);
///
- int latex(std::ostream &, bool fragile, bool free_spc) const;
+ int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const;
///
- int ascii(std::ostream &, int linelen) const;
+ int ascii(Buffer const *, std::ostream &, int linelen) const;
///
- int linuxdoc(std::ostream &) const;
+ int linuxdoc(Buffer const *, std::ostream &) const;
///
- int docbook(std::ostream &) const;
+ int docbook(Buffer const *, std::ostream &) const;
///
Inset * clone(Buffer const &, bool same_id = false) const;
}
-void InsetFormulaBase::read(Buffer const *, LyXLex & lex)
-{
- read(lex);
-}
-
-
-void InsetFormulaBase::write(Buffer const *, ostream & os) const
-{
- write(os);
-}
-
-
-int InsetFormulaBase::latex(Buffer const *, ostream & os,
- bool fragile, bool spacing) const
-{
- return latex(os, fragile, spacing);
-}
-
-
-int InsetFormulaBase::ascii(Buffer const *, ostream & os, int spacing) const
-{
- return ascii(os, spacing);
-}
-
-
-int InsetFormulaBase::linuxdoc(Buffer const *, ostream & os) const
-{
- return linuxdoc(os);
-}
-
-
-int InsetFormulaBase::docbook(Buffer const *, ostream & os) const
-{
- return docbook(os);
-}
-
-
-
// Check if uses AMS macros
void InsetFormulaBase::validate(LaTeXFeatures &) const
{}
InsetFormulaBase * f;
if (sel.empty()) {
- f = new InsetFormula;
- if (openNewInset(bv, f)) {
- // don't do that also for LFUN_MATH_MODE unless you want end up with
- // always changing to mathrm when opening an inlined inset
- // -- I really hate "LyXfunc overloading"...
- if (display)
- f->localDispatch(bv, LFUN_MATH_DISPLAY, string());
- f->localDispatch(bv, LFUN_INSERT_MATH, arg);
- }
+ f = new InsetFormula;
+ if (openNewInset(bv, f)) {
+ // don't do that also for LFUN_MATH_MODE unless you want end up with
+ // always changing to mathrm when opening an inlined inset
+ // -- I really hate "LyXfunc overloading"...
+ if (display)
+ f->localDispatch(bv, LFUN_MATH_DISPLAY, string());
+ f->localDispatch(bv, LFUN_INSERT_MATH, arg);
+ }
} else {
// create a macro if we see "\\newcommand" somewhere, and an ordinary
// formula otherwise
virtual int width(BufferView *, LyXFont const &) const = 0;
///
virtual void draw(BufferView *,LyXFont const &, int, float &, bool) const = 0;
-
- /// These are just wrappers taking the unused Buffer * dummy parameter
- ///
- virtual void write(Buffer const *, std::ostream &) const;
- ///
- virtual void read(Buffer const *, LyXLex & lex);
- ///
- virtual int latex(Buffer const *, std::ostream &,
- bool fragile, bool free_spc) const;
- ///
- virtual int ascii(Buffer const *, std::ostream &, int linelen) const;
- ///
- virtual int linuxdoc(Buffer const *, std::ostream &) const;
- ///
- virtual int docbook(Buffer const *, std::ostream &) const;
///
virtual MathInsetTypes getType() const = 0;
-protected:
- /// the actual functions don't use the Buffer * parameter
- ///
- virtual void write(std::ostream &) const = 0;
- ///
- virtual void read(LyXLex & lex) = 0;
- ///
- virtual int latex(std::ostream &, bool fragile, bool free_spc) const = 0;
- ///
- virtual int ascii(std::ostream &, int linelen) const = 0;
- ///
- virtual int linuxdoc(std::ostream &) const = 0;
- ///
- virtual int docbook(std::ostream &) const = 0;
-
public:
///
virtual void validate(LaTeXFeatures &) const;
}
-void InsetFormulaMacro::write(ostream & os) const
+void InsetFormulaMacro::write(Buffer const *, ostream & os) const
{
os << "FormulaMacro ";
tmacro().write(os, false);
}
-int InsetFormulaMacro::latex(ostream & os, bool fragile,
+int InsetFormulaMacro::latex(Buffer const *, ostream & os, bool fragile,
bool /*free_spacing*/) const
{
tmacro().write(os, fragile);
return 2;
}
-int InsetFormulaMacro::ascii(ostream & os, int) const
+int InsetFormulaMacro::ascii(Buffer const *, ostream & os, int) const
{
tmacro().write(os, false);
return 0;
}
-int InsetFormulaMacro::linuxdoc(ostream & os) const
+int InsetFormulaMacro::linuxdoc(Buffer const * buf, ostream & os) const
{
- return ascii(os, 0);
+ return ascii(buf, os, 0);
}
-int InsetFormulaMacro::docbook(ostream & os) const
+int InsetFormulaMacro::docbook(Buffer const * buf, ostream & os) const
{
- return ascii(os, 0);
+ return ascii(buf, os, 0);
}
-void InsetFormulaMacro::read(LyXLex & lex)
+void InsetFormulaMacro::read(Buffer const *, LyXLex & lex)
{
MathMacroTemplate * t = mathed_parse_macro(lex);
if (!t)
///
int width(BufferView *, LyXFont const &) const;
///
- void draw(BufferView *,LyXFont const &, int, float &, bool) const;
+ void draw(BufferView *, LyXFont const &, int, float &, bool) const;
///
- void read(LyXLex & lex);
+ void read(Buffer const *, LyXLex & lex);
///
- int ascii(std::ostream &, int linelen) const;
+ void write(Buffer const *, std::ostream & os) const;
///
- int latex(std::ostream & os, bool fragile, bool free_spc) const;
+ int ascii(Buffer const *, std::ostream &, int linelen) const;
///
- int linuxdoc(std::ostream & os) const;
+ int latex(Buffer const *, std::ostream & os, bool fragile, bool free_spc) const;
///
- int docbook(std::ostream &) const;
+ int linuxdoc(Buffer const *, std::ostream & os) const;
+ ///
+ int docbook(Buffer const *, std::ostream &) const;
///
Inset * clone(Buffer const &, bool same_id = false) const;
MathMacroTemplate const & tmacro() const;
/// prefix in inset
string prefix() const;
- ///
- void write(std::ostream & os) const;
};
#endif
}
-void MathCursor::dump(char const * what) const
+void MathCursor::dump(char const *) const
{
#if 0
lyxerr << "MC: " << what << "\n";