]> git.lyx.org Git - lyx.git/commitdiff
Use dummy Buffer * parameters to make Jean-Marc's compiler happy
authorAndré Pönitz <poenitz@gmx.net>
Mon, 24 Sep 2001 13:38:52 +0000 (13:38 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 24 Sep 2001 13:38:52 +0000 (13:38 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2793 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/formula.C
src/mathed/formula.h
src/mathed/formulabase.C
src/mathed/formulabase.h
src/mathed/formulamacro.C
src/mathed/formulamacro.h
src/mathed/math_cursor.C

index d6c7bb40c6b9ef41ae34637865ba100f6916e070..ca63b9210fe7e48a65424c1a2482f3f94eac5d72 100644 (file)
@@ -88,40 +88,40 @@ Inset * InsetFormula::clone(Buffer const &, bool) const
 }
 
 
-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();
index 294eb87f10f2be2c959450b9c24b0ff5e7712e18..bceefc0f334ea8b67298a3b2e9385015724b019d 100644 (file)
@@ -53,17 +53,17 @@ public:
        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;
index 72a0916348806117f96e263e4681c3aea7ea2201..a9b75d324d85f00ef5a2c82d363cff917e0a0e25 100644 (file)
@@ -110,44 +110,6 @@ InsetFormulaBase::InsetFormulaBase()
 }
 
 
-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
 {}
@@ -726,15 +688,15 @@ void mathDispatchCreation(BufferView * bv, string const & arg, bool display)
 
                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
index f206eece754bf9927824ed9846d4b2fedd0eee02..022b6352530dfa02ed7b4adad14ec6dd64de227d 100644 (file)
@@ -42,39 +42,9 @@ public:
        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;
index d6f574aba06c9da261aac852fb56170fe7f2391b..cffb87b422402f68c96b943bf27e0e8a9dc626df 100644 (file)
@@ -72,40 +72,40 @@ Inset * InsetFormulaMacro::clone(Buffer const &, bool) 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) 
index 842613ceaeeaacb96415633b563422384a1150d3..44682779540246bdf843a25e66b2456ccb07c346 100644 (file)
@@ -44,18 +44,20 @@ public:
        ///
        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;
@@ -74,8 +76,6 @@ private:
        MathMacroTemplate const & tmacro() const;
        /// prefix in inset
        string prefix() const;
-       ///
-       void write(std::ostream & os) const;
 };
 
 #endif
index aa809f93939ea58af8bc1de146966e51d4b85a24..6e62c43f5e16ae2d7b52018c965a6edcce583d44 100644 (file)
@@ -169,7 +169,7 @@ MathInset * MathCursor::parInset(int i) const
 }
 
 
-void MathCursor::dump(char const * what) const
+void MathCursor::dump(char const *) const
 {
 #if 0
        lyxerr << "MC: " << what << "\n";