From 27ef7c726f4e688b615798bad160c5e6af47c3d5 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 30 Oct 2006 20:10:35 +0000 Subject: [PATCH] * LyXText::singleWidth(): remove unneeded Buffer argument. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15627 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/lyxtext.h | 4 ++-- src/rowpainter.C | 12 +++++------- src/text.C | 10 +++++----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lyxtext.h b/src/lyxtext.h index 3fba327362..d45c181532 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -276,8 +276,8 @@ public: int singleWidth(Buffer const &, Paragraph const & par, pos_type pos) const; /// - int singleWidth(Buffer const &, Paragraph const & par, - pos_type pos, char_type c, LyXFont const & Font) const; + int singleWidth(Paragraph const & par, pos_type pos, char_type c, + LyXFont const & Font) const; /// return the color of the canvas LColor_color backgroundColor() const; diff --git a/src/rowpainter.C b/src/rowpainter.C index f29b51e1d5..4147a742bd 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -202,9 +202,8 @@ void RowPainter::paintHebrewComposeChar(pos_type & vpos, LyXFont const & font) c = par_.getChar(i); if (!Encodings::isComposeChar_hebrew(c)) { if (isPrintableNonspace(c)) { - int const width2 = - text_.singleWidth(*bv_.buffer(), par_, i, c, - text_.getFont(*bv_.buffer(), par_, i)); + int const width2 = text_.singleWidth(par_, i, c, + text_.getFont(*bv_.buffer(), par_, i)); // FIXME UNICODE // This does not work anymore, and non-ascii // characters in source files are forbidden @@ -242,8 +241,7 @@ void RowPainter::paintArabicComposeChar(pos_type & vpos, LyXFont const & font) c = par_.getChar(i); if (!Encodings::isComposeChar_arabic(c)) { if (isPrintableNonspace(c)) { - int const width2 = - text_.singleWidth(*bv_.buffer(), par_, i, c, + int const width2 = text_.singleWidth(par_, i, c, text_.getFont(*bv_.buffer(), par_, i)); dx = (width2 - width) / 2; } @@ -668,8 +666,8 @@ void RowPainter::paintText() font = text_.getFont(buffer, par_, vpos); } - const int width_pos = text_.singleWidth(buffer, par_, pos, - par_.getChar(pos), font); + const int width_pos = + text_.singleWidth(par_, pos, par_.getChar(pos), font); if (x_ + width_pos < 0) { x_ += width_pos; diff --git a/src/text.C b/src/text.C index 6a8ae7f620..72adec999d 100644 --- a/src/text.C +++ b/src/text.C @@ -427,12 +427,12 @@ int LyXText::height() const int LyXText::singleWidth(Buffer const & buffer, Paragraph const & par, pos_type pos) const { - return singleWidth(buffer, par, pos, par.getChar(pos), + return singleWidth(par, pos, par.getChar(pos), getFont(buffer, par, pos)); } -int LyXText::singleWidth(Buffer const & buffer, Paragraph const & par, +int LyXText::singleWidth(Paragraph const & par, pos_type pos, char_type c, LyXFont const & font) const { // The most common case is handled first (Asger) @@ -742,7 +742,7 @@ void LyXText::rowBreakPoint(Buffer const & buffer, pit_type const pit, FontMetrics const & fm = theFontMetrics(getLabelFont(buffer, par)); for ( ; i < end; ++i, ++fi) { char_type const c = par.getChar(i); - int thiswidth = singleWidth(buffer, par, i, c, *fi); + int thiswidth = singleWidth(par, i, c, *fi); // add the auto-hfill from label end to the body if (body_pos && i == body_pos) { @@ -838,7 +838,7 @@ void LyXText::setRowWidth(Buffer const & buffer, pit_type const pit, Row & row) w = max(w, labelEnd(buffer, pit)); } char_type const c = par.getChar(i); - w += singleWidth(buffer, par, i, c, *fi); + w += singleWidth(par, i, c, *fi); } } @@ -2328,7 +2328,7 @@ int LyXText::cursorX(Buffer const & buffer, CursorSlice const & sl, font = getFont(buffer, par, pos); } - x += singleWidth(buffer, par, pos, par.getChar(pos), font); + x += singleWidth(par, pos, par.getChar(pos), font); if (par.hfillExpansion(row, pos)) x += (pos >= body_pos) ? m.hfill : m.label_hfill; -- 2.39.5