]> git.lyx.org Git - features.git/commitdiff
* LyXText::singleWidth(): remove unneeded Buffer argument.
authorAbdelrazak Younes <younes@lyx.org>
Mon, 30 Oct 2006 20:10:35 +0000 (20:10 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 30 Oct 2006 20:10:35 +0000 (20:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15627 a592a061-630c-0410-9148-cb99ea01b6c8

src/lyxtext.h
src/rowpainter.C
src/text.C

index 3fba32736201ac8fc22ab2a8fcfdfa85faff1537..d45c181532a00ec1aa65caaf271b844f35489a40 100644 (file)
@@ -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;
index f29b51e1d592023d038c0cfeefdc95d62cc2c006..4147a742bd5139bb488930252cae56d677ec95d1 100644 (file)
@@ -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;
index 6a8ae7f620ad82631127bf478ba83869172dc5c6..72adec999d631e20ce718a81d092a486e35f4d36 100644 (file)
@@ -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;