]> git.lyx.org Git - features.git/commitdiff
Make Angus' compiler happy
authorAndré Pönitz <poenitz@gmx.net>
Thu, 21 Mar 2002 06:57:13 +0000 (06:57 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 21 Mar 2002 06:57:13 +0000 (06:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3794 a592a061-630c-0410-9148-cb99ea01b6c8

22 files changed:
src/mathed/formula.C
src/mathed/math_charinset.C
src/mathed/math_charinset.h
src/mathed/math_diminset.C
src/mathed/math_diminset.h
src/mathed/math_fracinset.C
src/mathed/math_fracinset.h
src/mathed/math_gridinset.C
src/mathed/math_gridinset.h
src/mathed/math_hullinset.C
src/mathed/math_hullinset.h
src/mathed/math_inset.C
src/mathed/math_inset.h
src/mathed/math_metricsinfo.h
src/mathed/math_scriptinset.C
src/mathed/math_scriptinset.h
src/mathed/math_sqrtinset.C
src/mathed/math_sqrtinset.h
src/mathed/math_symbolinset.C
src/mathed/math_xdata.C
src/mathed/math_xdata.h
src/mathed/math_xyarrowinset.C

index 0ee8c14d2dae92af3807016434b3659aac0dfd9b..09930934b412415127528ce99951aad001fd9972 100644 (file)
@@ -297,9 +297,9 @@ int InsetFormula::ascii(Buffer const *, ostream & os, int) const
 {
 #if 1
        TextMetricsInfo mi;
-       par()->metrics(mi);
+       par()->metricsT(mi);
        TextPainter tpain(par()->width(), par()->height());
-       par()->draw(tpain, 0, par()->ascent());
+       par()->drawT(tpain, 0, par()->ascent());
        tpain.show(os);
        // reset metrics cache to "real" values
        metrics();
index 4e056afb0745a8950b97a4ed0cf25bb1d64b79f5..1e65c67936021196842dcd35587bb132ee90dfd1 100644 (file)
@@ -80,7 +80,7 @@ void MathCharInset::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathCharInset::metrics(TextMetricsInfo const &) const
+void MathCharInset::metricsT(TextMetricsInfo const &) const
 {
        width_   = 1;
        ascent_  = 1;
@@ -88,7 +88,7 @@ void MathCharInset::metrics(TextMetricsInfo const &) const
 }
 
 
-void MathCharInset::draw(TextPainter & pain, int x, int y) const
+void MathCharInset::drawT(TextPainter & pain, int x, int y) const
 { 
        //lyxerr << "drawing text '" << char_ << "' code: " << code_ << endl;
        pain.draw(x, y, char_);
index eaba3cfcea321aee1d1507469342f8acf54cde20..645c56a2cc01b73ada3aa9341ed1e7493c9d5986 100644 (file)
@@ -27,9 +27,9 @@ public:
        ///
        void draw(Painter &, int x, int y) const;
        ///
-       void metrics(TextMetricsInfo const & st) const;
+       void metricsT(TextMetricsInfo const & st) const;
        ///
-       void draw(TextPainter &, int x, int y) const;
+       void drawT(TextPainter &, int x, int y) const;
        ///
        void write(WriteStream & os) const;
        ///
index 727b5b01d7e5d9ab14e629d9b97171e3a134e4b7..c1640dbb7b589fd74f42727143f881d74f0b9c34 100644 (file)
@@ -4,7 +4,7 @@
 #include "textpainter.h"
 
 
-void MathDimInset::metrics(TextMetricsInfo const &) const
+void MathDimInset::metricsT(TextMetricsInfo const &) const
 {
        std::ostringstream os;
        os << *this;
@@ -14,7 +14,7 @@ void MathDimInset::metrics(TextMetricsInfo const &) const
 }
 
 
-void MathDimInset::draw(TextPainter & pain, int x, int y) const
+void MathDimInset::drawT(TextPainter & pain, int x, int y) const
 {
        std::ostringstream os;
        os << *this;
index a208b3f3cb3c25d41ceb992f225f48c55a90443e..601f477b101d7a6171f9efceca21abc73cae568d 100644 (file)
@@ -17,9 +17,9 @@ public:
        /// read width
        int width() const { return width_; }
        ///
-       void metrics(TextMetricsInfo const &) const;
+       void metricsT(TextMetricsInfo const &) const;
        ///
-       void draw(TextPainter & pain, int x, int y) const;
+       void drawT(TextPainter & pain, int x, int y) const;
 
 protected:
        ///
index fc82e507c3ab1e225157d2423b1652f0c604c239..c99a2e0743490251879e787ec9dbc9a3b812b2fb 100644 (file)
@@ -51,21 +51,21 @@ void MathFracInset::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathFracInset::metrics(TextMetricsInfo const & mi) const
+void MathFracInset::metricsT(TextMetricsInfo const & mi) const
 {
-       xcell(0).metrics(mi);
-       xcell(1).metrics(mi);
+       xcell(0).metricsT(mi);
+       xcell(1).metricsT(mi);
        width_   = max(xcell(0).width(), xcell(1).width());
        ascent_  = xcell(0).height() + 1;
        descent_ = xcell(1).height();
 }
 
 
-void MathFracInset::draw(TextPainter & pain, int x, int y) const
+void MathFracInset::drawT(TextPainter & pain, int x, int y) const
 {
        int m = x + width() / 2;
-       xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).descent() - 1);
-       xcell(1).draw(pain, m - xcell(1).width() / 2, y + xcell(1).ascent());
+       xcell(0).drawT(pain, m - xcell(0).width() / 2, y - xcell(0).descent() - 1);
+       xcell(1).drawT(pain, m - xcell(1).width() / 2, y + xcell(1).ascent());
        if (!atop_)
                pain.horizontalLine(x, y, width());
 }
index a54c55384bd826bede0f4e15de33b082ce2bcd66..b86509951d2216d446ff4b9ec406d43a7817dd08 100644 (file)
@@ -22,9 +22,9 @@ public:
        ///
        void draw(Painter &, int x, int y) const;
        ///
-       void metrics(TextMetricsInfo const & mi) const;
+       void metricsT(TextMetricsInfo const & mi) const;
        ///
-       void draw(TextPainter &, int x, int y) const;
+       void drawT(TextPainter &, int x, int y) const;
        ///
        MathFracInset * asFracInset();
 
index 788020a7330eb335ab89105ef8f26ff8056e4a00..57f750a44cae6d62ecc44d199b71c7327e4d42a7 100644 (file)
@@ -376,12 +376,12 @@ void MathGridInset::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathGridInset::metrics(TextMetricsInfo const & mi) const
+void MathGridInset::metricsT(TextMetricsInfo const & mi) const
 {
        // let the cells adjust themselves
        //MathNestInset::metrics(mi);
        for (idx_type i = 0; i < nargs(); ++i) 
-               xcell(i).metrics(mi);
+               xcell(i).metricsT(mi);
 
        // compute absolute sizes of vertical structure
        for (row_type row = 0; row < nrows(); ++row) {
@@ -466,10 +466,10 @@ void MathGridInset::metrics(TextMetricsInfo const & mi) const
 }
 
 
-void MathGridInset::draw(TextPainter & pain, int x, int y) const
+void MathGridInset::drawT(TextPainter & pain, int x, int y) const
 {
        for (idx_type idx = 0; idx < nargs(); ++idx)
-               xcell(idx).draw(pain, x + cellXOffset(idx), y + cellYOffset(idx));
+               xcell(idx).drawT(pain, x + cellXOffset(idx), y + cellYOffset(idx));
 }
 
 
index d35177eed285b732200ac150b55cb0ba5c446425..dfcffeea2a755f2c4546914448b13114f6acfa85 100644 (file)
@@ -74,9 +74,9 @@ public:
        ///
        void draw(Painter &, int x, int y) const;
        ///
-       void metrics(TextMetricsInfo const & st) const;
+       void metricsT(TextMetricsInfo const & st) const;
        ///
-       void draw(TextPainter &, int x, int y) const;
+       void drawT(TextPainter &, int x, int y) const;
        ///
        void halign(string const &);
        ///
index b7a81ff1ed2bbe9cbc27a806686fdecf36d5105e..d1736f34d7d051bffa4ef13d092fd1d6896be7c1 100644 (file)
@@ -200,7 +200,7 @@ void MathHullInset::draw(Painter & pain, int x, int y) const
 }
 
 /*
-void MathHullInset::metrics(TextMetricsInfo const & mi) const
+void MathHullInset::metricsT(TextMetricsInfo const & mi) const
 {
        ascent_  = 1;
        descent_ = 0;
@@ -208,7 +208,7 @@ void MathHullInset::metrics(TextMetricsInfo const & mi) const
 }
 
 
-void MathHullInset::draw(TextPainter & pain, int x, int y) const
+void MathHullInset::drawT(TextPainter & pain, int x, int y) const
 {
        pain.draw(x, y, normalName(objtype_).c_str());
        MathGridInset::draw(pain, x, y);
index 9c683958ccfb249b40db03e8c1a1c5aea4729e9e..f112a1c785ebba709cc6f603f8836708357d8dd6 100644 (file)
@@ -31,9 +31,9 @@ public:
        ///
        void draw(Painter &, int x, int y) const;
        ///
-       //void metrics(TextMetricsInfo const & st) const;
+       //void metricsT(TextMetricsInfo const & st) const;
        ///
-       //void draw(TextPainter &, int x, int y) const;
+       //void drawT(TextPainter &, int x, int y) const;
        ///
        string label(row_type row) const;
        ///
index dfffb7b717f921a53e285a9b42adf59dfc2ff50e..cddb9f2437f62bd7c99dbfdc882b1e49db745db6 100644 (file)
@@ -206,15 +206,15 @@ void MathInset::draw(Painter &, int, int) const
 }
 
 
-void MathInset::metrics(TextMetricsInfo const &) const
+void MathInset::metricsT(TextMetricsInfo const &) const
 {
-       lyxerr << "MathInset::metrics(Text) called directly!\n";
+       lyxerr << "MathInset::metricsT(Text) called directly!\n";
 }
 
 
-void MathInset::draw(TextPainter &, int, int) const
+void MathInset::drawT(TextPainter &, int, int) const
 {
-       lyxerr << "MathInset::draw(Text) called directly!\n";
+       lyxerr << "MathInset::drawT(Text) called directly!\n";
 }
 
 
index 6783d5714c3704398c6df0737fc673c232379321..98fb08ff661cfe059b8bcd726562afde296902bc 100644 (file)
@@ -110,9 +110,9 @@ public:
        virtual void draw(Painter &, int x, int y) const;
        /// the ascent of the inset above the baseline
        /// compute the size of the object for text based drawing
-       virtual void metrics(TextMetricsInfo const & st) const;
+       virtual void metricsT(TextMetricsInfo const & st) const;
        /// draw the object as text
-       virtual void draw(TextPainter &, int x, int y) const;
+       virtual void drawT(TextPainter &, int x, int y) const;
        /// the ascent of the inset above the baseline
        virtual int ascent() const { return 1; }
        /// the descent of the inset below the baseline
index 26b542405b5f8bf51e5d16548fe696782330eb05..d68f10533b7e05e4e2af9248848f229658445041 100644 (file)
@@ -53,10 +53,6 @@ struct TextMetricsInfo {
        ///
        TextMetricsInfo()
                {}
-       /// used to pass some info down
-       MathNestInset const * inset;
-       ///
-       int idx;
 };
 
 #endif
index deffc36ffe2a4b6eee7582c36462cefc23cfb7f7..010b8f98fc623005b0984499d565e245414be4d9 100644 (file)
@@ -198,34 +198,34 @@ void MathScriptInset::metrics(MathInset const * nuc,
 }
 
 
-void MathScriptInset::metrics(TextMetricsInfo const & mi) const
+void MathScriptInset::draw(Painter & pain, int x, int y) const
+{  
+       //lyxerr << "unexpected call to MathScriptInset::draw()\n";
+       draw(0, pain, x, y);
+}
+
+
+void MathScriptInset::metricsT(TextMetricsInfo const & mi) const
 {      
-       metrics(0, mi);
+       metricsT(0, mi);
 }
 
 
-void MathScriptInset::metrics(MathInset const * nuc,
+void MathScriptInset::metricsT(MathInset const * nuc,
        TextMetricsInfo const & mi) const
 {      
        if (hasUp())
-               up().metrics(mi);
+               up().metricsT(mi);
        if (hasDown())
-               down().metrics(mi);
+               down().metricsT(mi);
        if (nuc)
-               nuc->metrics(mi);
+               nuc->metricsT(mi);
        //ascent_  = ascent2(nuc);
        //descent_ = descent2(nuc);
        //width_   = width2(nuc);
 }
 
 
-void MathScriptInset::draw(Painter & pain, int x, int y) const
-{  
-       //lyxerr << "unexpected call to MathScriptInset::draw()\n";
-       draw(0, pain, x, y);
-}
-
-
 void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
        int x, int y) const
 {  
@@ -241,22 +241,22 @@ void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
                down().draw(pain, x + dx0(nuc), y + dy0(nuc));
 }
 
-void MathScriptInset::draw(TextPainter & pain, int x, int y) const
+void MathScriptInset::drawT(TextPainter & pain, int x, int y) const
 {  
        //lyxerr << "unexpected call to MathScriptInset::draw()\n";
-       draw(0, pain, x, y);
+       drawT(0, pain, x, y);
 }
 
 
-void MathScriptInset::draw(MathInset const * nuc, TextPainter & pain,
+void MathScriptInset::drawT(MathInset const * nuc, TextPainter & pain,
        int x, int y) const
 {  
        if (nuc)
-               nuc->draw(pain, x + dxx(nuc), y);
+               nuc->drawT(pain, x + dxx(nuc), y);
        if (hasUp())
-               up().draw(pain, x + dx1(nuc), y - dy1(nuc));
+               up().drawT(pain, x + dx1(nuc), y - dy1(nuc));
        if (hasDown())
-               down().draw(pain, x + dx0(nuc), y + dy0(nuc));
+               down().drawT(pain, x + dx0(nuc), y + dy0(nuc));
 }
 
 
index dfe82affcfa3a5cdeb3b2e387f7c195e6bcf23eb..15eb649f61acb3b82ac64a953413e19973a686f0 100644 (file)
@@ -29,18 +29,18 @@ public:
        ///
        void draw(Painter &, int x, int y) const;
        ///
-       void metrics(TextMetricsInfo const & st) const;
+       void metricsT(TextMetricsInfo const & st) const;
        ///
-       void draw(TextPainter &, int x, int y) const;
+       void drawT(TextPainter &, int x, int y) const;
 
        ///
        void metrics(MathInset const * nuc, MathMetricsInfo const & st) const;
        ///
        void draw(MathInset const * nuc, Painter &, int x, int y) const;
        ///
-       void metrics(MathInset const * nuc, TextMetricsInfo const & st) const;
+       void metricsT(MathInset const * nuc, TextMetricsInfo const & st) const;
        ///
-       void draw(MathInset const * nuc, TextPainter &, int x, int y) const;
+       void drawT(MathInset const * nuc, TextPainter &, int x, int y) const;
        ///
        int ascent2(MathInset const * nuc) const;
        ///
index f71e16f331c60c16e4d15606401e0b040e1b2ce4..85a0053980588339bc2648e14f935e448f2ac34a 100644 (file)
@@ -44,18 +44,18 @@ void MathSqrtInset::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathSqrtInset::metrics(TextMetricsInfo const & mi) const
+void MathSqrtInset::metricsT(TextMetricsInfo const & mi) const
 {
-       xcell(0).metrics(mi);
+       xcell(0).metricsT(mi);
        ascent_  = xcell(0).ascent()  + 1;
        descent_ = xcell(0).descent();
        width_   = xcell(0).width()   + 2;
 }
 
 
-void MathSqrtInset::draw(TextPainter & pain, int x, int y) const
+void MathSqrtInset::drawT(TextPainter & pain, int x, int y) const
 { 
-       xcell(0).draw(pain, x + 2, y); 
+       xcell(0).drawT(pain, x + 2, y); 
        pain.horizontalLine(x + 2, y - xcell(0).ascent(), xcell(0).width(), '_');
        pain.verticalLine  (x + 1, y - xcell(0).ascent() + 1, xcell(0).height());
        pain.draw(x, y + xcell(0).descent(), '\\');
index 357ff5557d9e24c22b055fe64c9cdacaa250c028..a5af7164b424a0e740b7b0f90cdc0a52215a96f0 100644 (file)
@@ -22,9 +22,9 @@ public:
        ///
        void metrics(MathMetricsInfo const & mi) const;
        ///
-       void draw(TextPainter &, int x, int y) const;
+       void drawT(TextPainter &, int x, int y) const;
        ///
-       void metrics(TextMetricsInfo const & mi) const;
+       void metricsT(TextMetricsInfo const & mi) const;
 
        ///
        void write(WriteStream & os) const;
index bfc6b916d222da9f1d631a2b8ec06686385c789b..962e34d219aafd6772424c18f72b397324ef8bd6 100644 (file)
@@ -77,7 +77,7 @@ void MathSymbolInset::metrics(MathMetricsInfo const & mi) const
        MathTextCodes c = code();
        if (sym_->latex_font_id > 0 && math_font_available(c)) {
                whichFont(font, c, mi_);
-               mathed_char_dim(font, sym_->latex_font_id, ascent_, descent_, width_);
+               mathed_char_dim(font, char(sym_->latex_font_id), ascent_, descent_, width_);
                if (c == LM_TC_CMEX) {
                        h_ = 4 * descent_ / 5;
                        ascent_  += h_;
@@ -86,7 +86,7 @@ void MathSymbolInset::metrics(MathMetricsInfo const & mi) const
        } else {
                if (sym_->id > 0 && sym_->id < 255 && math_font_available(LM_TC_SYMB)) {
                        whichFont(font, code2(), mi_);
-                       mathed_char_dim(font, sym_->id, ascent_, descent_, width_);
+                       mathed_char_dim(font, char(sym_->id), ascent_, descent_, width_);
                } else {
                        whichFont(font, LM_TC_TEX, mi_);
                        mathed_string_dim(font, sym_->name, ascent_, descent_, width_);
@@ -105,10 +105,10 @@ void MathSymbolInset::draw(Painter & pain, int x, int y) const
        LyXFont font;
        if (sym_->latex_font_id > 0 && math_font_available(Code)) {
                whichFont(font, Code, mi_);
-               drawChar(pain, font, x, y - h_, sym_->latex_font_id);
+               drawChar(pain, font, x, y - h_, char(sym_->latex_font_id));
        } else if (sym_->id > 0 && sym_->id < 255 && math_font_available(LM_TC_SYMB)){
                whichFont(font, code2(), mi_);
-               drawChar(pain, font, x, y, sym_->id);
+               drawChar(pain, font, x, y, char(sym_->id));
        } else {
                whichFont(font, LM_TC_TEX, mi_);
                drawStr(pain, font, x, y, sym_->name);
index 7a5192350bbe377558a1f0eebb59792141e944e6..e0bb7bac497f28c9356fd8dd96120a59c2cf983d 100644 (file)
@@ -114,7 +114,7 @@ void MathXArray::draw(Painter & pain, int x, int y) const
 }
 
 
-void MathXArray::metrics(TextMetricsInfo const & mi) const
+void MathXArray::metricsT(TextMetricsInfo const & mi) const
 {
        //if (clean_)
        //      return;
@@ -127,13 +127,13 @@ void MathXArray::metrics(TextMetricsInfo const & mi) const
                MathInset const * p = it->nucleus();
                MathScriptInset const * q = (it + 1 == end()) ? 0 : asScript(it);
                if (q) {
-                       q->metrics(p, mi);
+                       q->metricsT(p, mi);
                        ascent_  = max(ascent_,  q->ascent2(p));
                        descent_ = max(descent_, q->descent2(p));
                        width_  += q->width2(p);        
                        ++it;
                } else {
-                       p->metrics(mi);
+                       p->metricsT(mi);
                        ascent_  = max(ascent_,  p->ascent());
                        descent_ = max(descent_, p->descent());
                        width_  += p->width();  
@@ -142,7 +142,7 @@ void MathXArray::metrics(TextMetricsInfo const & mi) const
 }
 
 
-void MathXArray::draw(TextPainter & pain, int x, int y) const
+void MathXArray::drawT(TextPainter & pain, int x, int y) const
 {
        //if (drawn_ && x == xo_ && y == yo_)
        //      return;
@@ -159,11 +159,11 @@ void MathXArray::draw(TextPainter & pain, int x, int y) const
                MathInset const * p = it->nucleus();
                MathScriptInset const * q = (it + 1 == et) ? 0 : asScript(it);
                if (q) {
-                       q->draw(p, pain, x, y);
+                       q->drawT(p, pain, x, y);
                        x += q->width2(p);
                        ++it;
                } else {
-                       p->draw(pain, x, y);
+                       p->drawT(pain, x, y);
                        x += p->width();
                }
        }
index 082711b8238f2d8cb10b6a5ceeb51ef11883cdcc..48518de561dd862032308162cd008284212541cb 100644 (file)
@@ -34,9 +34,9 @@ public:
        /// redraw cell using cache metrics information
        void draw(Painter & pain, int x, int y) const;
        /// rebuild cached metrics information
-       void metrics(TextMetricsInfo const & st) const;
+       void metricsT(TextMetricsInfo const & st) const;
        /// redraw cell using cache metrics information
-       void draw(TextPainter & pain, int x, int y) const;
+       void drawT(TextPainter & pain, int x, int y) const;
        /// mark cell for re-drawing
        void touch() const;
 
index 87dde936c598ebdbfaeb62e04c03afc9e9763051..4a48b4228dd662d8e0b62b6ecb194adab7a34d91 100644 (file)
@@ -48,8 +48,8 @@ MathXArray const & MathXYArrowInset::targetCell() const
                }
        }
        //lyxerr << "target: x: " << x << " y: " << y << "\n";
-       int n = mi_.idx + p->ncols() * y + x;
-       if (n < 0 || n >= int(p->nargs())) {
+       MathInset::idx_type n = mi_.idx + p->ncols() * y + x;
+       if (n >= p->nargs()) {
                lyxerr << "source: n: " << mi_.idx << "\n";
                lyxerr << "target: n: " << n << " out of range\n";
                n = 0;