From 86323de88fe275b9a0b1daaa5d16d6d612f4f819 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 11 Jul 2002 14:28:11 +0000 Subject: [PATCH] remove unneede functions git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4602 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_support.C | 30 +++++------------------------- src/mathed/math_support.h | 18 ++++++------------ 2 files changed, 11 insertions(+), 37 deletions(-) diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index ee65b1b69f..7f662a235d 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -372,20 +372,19 @@ int mathed_char_width(LyXFont const & font, unsigned char c) } -void mathed_string_dim(LyXFont const & font, - string const & s, int & asc, int & des, int & wid) -{ -} - - void mathed_string_dim(LyXFont const & font, string const & s, Dimension & dim) { +#if 1 dim.a = 0; dim.d = 0; for (string::const_iterator it = s.begin(); it != s.end(); ++it) { dim.a = max(dim.a, font_metrics::ascent(*it, font)); dim.d = max(dim.d, font_metrics::descent(*it, font)); } +#else + dim.a = font_metrics::maxAscent(font); + dim.d = font_metrics::maxDescent(font); +#endif dim.w = font_metrics::width(s, font); } @@ -396,25 +395,6 @@ int mathed_string_width(LyXFont const & font, string const & s) } -int mathed_string_ascent(LyXFont const & font, string const & s) -{ - int asc = 0; - for (string::const_iterator it = s.begin(); it != s.end(); ++it) - asc = max(asc, font_metrics::ascent(*it, font)); - return asc; -} - - -int mathed_string_descent(LyXFont const & font, string const & s) -{ - int des = 0; - for (string::const_iterator it = s.begin(); it != s.end(); ++it) - des = max(des, font_metrics::descent(*it, font)); - return des; -} - - - void mathed_draw_deco(MathPainterInfo & pi, int x, int y, int w, int h, const string & name) { diff --git a/src/mathed/math_support.h b/src/mathed/math_support.h index a0468150c3..76d4a6f4b0 100644 --- a/src/mathed/math_support.h +++ b/src/mathed/math_support.h @@ -6,9 +6,6 @@ #include "LString.h" class MathPainterInfo; -class TextPainter; -class latexkeys; -class MathMetricsInfo; class MathInset; class LyXFont; class Dimension; @@ -18,22 +15,19 @@ int mathed_char_width(LyXFont const &, unsigned char c); int mathed_char_ascent(LyXFont const &, unsigned char c); int mathed_char_descent(LyXFont const &, unsigned char c); -void mathed_draw_deco(MathPainterInfo & pain, int x, int y, int w, int h, +void mathed_draw_deco(MathPainterInfo & pi, int x, int y, int w, int h, string const & name); -void mathed_draw_framebox(MathPainterInfo & pain, int x, int y, MathInset const *); +void mathed_draw_framebox(MathPainterInfo & pi, int x, int y, MathInset const *); void mathed_string_dim(LyXFont const & font, string const & s, Dimension & dim); int mathed_string_width(LyXFont const &, string const & s); -int mathed_string_ascent(LyXFont const &, string const & s); -int mathed_string_descent(LyXFont const &, string const & s); -void drawStr(MathPainterInfo & pain, +void drawStr(MathPainterInfo & pi, LyXFont const &, int x, int y, string const & s); -void drawStrRed(MathPainterInfo & pain, int x, int y, string const & s); -void drawStrBlack(MathPainterInfo & pain, int x, int y, string const & s); -void drawChar(MathPainterInfo & pain, - LyXFont const & font, int x, int y, char c); +void drawStrRed(MathPainterInfo & pi, int x, int y, string const & s); +void drawStrBlack(MathPainterInfo & pi, int x, int y, string const & s); +void drawChar(MathPainterInfo & pi, LyXFont const & font, int x, int y, char c); void math_font_max_dim(LyXFont const &, int & asc, int & desc); -- 2.39.2