From: André Pönitz Date: Thu, 21 Mar 2002 06:57:13 +0000 (+0000) Subject: Make Angus' compiler happy X-Git-Tag: 1.6.10~19607 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=277e3050821209fa728d05c98b30476eead6e4fb;p=features.git Make Angus' compiler happy git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3794 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 0ee8c14d2d..09930934b4 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -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(); diff --git a/src/mathed/math_charinset.C b/src/mathed/math_charinset.C index 4e056afb07..1e65c67936 100644 --- a/src/mathed/math_charinset.C +++ b/src/mathed/math_charinset.C @@ -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_); diff --git a/src/mathed/math_charinset.h b/src/mathed/math_charinset.h index eaba3cfcea..645c56a2cc 100644 --- a/src/mathed/math_charinset.h +++ b/src/mathed/math_charinset.h @@ -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; /// diff --git a/src/mathed/math_diminset.C b/src/mathed/math_diminset.C index 727b5b01d7..c1640dbb7b 100644 --- a/src/mathed/math_diminset.C +++ b/src/mathed/math_diminset.C @@ -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; diff --git a/src/mathed/math_diminset.h b/src/mathed/math_diminset.h index a208b3f3cb..601f477b10 100644 --- a/src/mathed/math_diminset.h +++ b/src/mathed/math_diminset.h @@ -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: /// diff --git a/src/mathed/math_fracinset.C b/src/mathed/math_fracinset.C index fc82e507c3..c99a2e0743 100644 --- a/src/mathed/math_fracinset.C +++ b/src/mathed/math_fracinset.C @@ -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()); } diff --git a/src/mathed/math_fracinset.h b/src/mathed/math_fracinset.h index a54c55384b..b86509951d 100644 --- a/src/mathed/math_fracinset.h +++ b/src/mathed/math_fracinset.h @@ -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(); diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 788020a733..57f750a44c 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -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)); } diff --git a/src/mathed/math_gridinset.h b/src/mathed/math_gridinset.h index d35177eed2..dfcffeea2a 100644 --- a/src/mathed/math_gridinset.h +++ b/src/mathed/math_gridinset.h @@ -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 &); /// diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index b7a81ff1ed..d1736f34d7 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -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); diff --git a/src/mathed/math_hullinset.h b/src/mathed/math_hullinset.h index 9c683958cc..f112a1c785 100644 --- a/src/mathed/math_hullinset.h +++ b/src/mathed/math_hullinset.h @@ -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; /// diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index dfffb7b717..cddb9f2437 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -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"; } diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 6783d5714c..98fb08ff66 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -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 diff --git a/src/mathed/math_metricsinfo.h b/src/mathed/math_metricsinfo.h index 26b542405b..d68f10533b 100644 --- a/src/mathed/math_metricsinfo.h +++ b/src/mathed/math_metricsinfo.h @@ -53,10 +53,6 @@ struct TextMetricsInfo { /// TextMetricsInfo() {} - /// used to pass some info down - MathNestInset const * inset; - /// - int idx; }; #endif diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index deffc36ffe..010b8f98fc 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -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)); } diff --git a/src/mathed/math_scriptinset.h b/src/mathed/math_scriptinset.h index dfe82affcf..15eb649f61 100644 --- a/src/mathed/math_scriptinset.h +++ b/src/mathed/math_scriptinset.h @@ -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; /// diff --git a/src/mathed/math_sqrtinset.C b/src/mathed/math_sqrtinset.C index f71e16f331..85a0053980 100644 --- a/src/mathed/math_sqrtinset.C +++ b/src/mathed/math_sqrtinset.C @@ -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(), '\\'); diff --git a/src/mathed/math_sqrtinset.h b/src/mathed/math_sqrtinset.h index 357ff5557d..a5af7164b4 100644 --- a/src/mathed/math_sqrtinset.h +++ b/src/mathed/math_sqrtinset.h @@ -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; diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index bfc6b916d2..962e34d219 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -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); diff --git a/src/mathed/math_xdata.C b/src/mathed/math_xdata.C index 7a5192350b..e0bb7bac49 100644 --- a/src/mathed/math_xdata.C +++ b/src/mathed/math_xdata.C @@ -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(); } } diff --git a/src/mathed/math_xdata.h b/src/mathed/math_xdata.h index 082711b823..48518de561 100644 --- a/src/mathed/math_xdata.h +++ b/src/mathed/math_xdata.h @@ -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; diff --git a/src/mathed/math_xyarrowinset.C b/src/mathed/math_xyarrowinset.C index 87dde936c5..4a48b4228d 100644 --- a/src/mathed/math_xyarrowinset.C +++ b/src/mathed/math_xyarrowinset.C @@ -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;