]> git.lyx.org Git - features.git/commitdiff
rowlist6
authorLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 31 Mar 2003 11:16:39 +0000 (11:16 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Mon, 31 Mar 2003 11:16:39 +0000 (11:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6659 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxtext.h
src/text2.C

index 18d450839a466368bab23bd18ca8bfdf1b2c30df..87f859a240d0d5915cd3f4c9c682784e7d1b41da 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-31  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * text2.C (getCursorX): make it take a RowList::iterator as arg,
+       adjust.
+
 2003-03-31  John Levon  <levon@movementarian.org>
 
        * lyxrc.h:
index 32f98386fbbda943d977eea6fd0efe7da00bc65a..d6e8d89137c9b1fa46ad087b8d80a169493823a1 100644 (file)
@@ -495,7 +495,7 @@ private:
        void cursorLeftOneWord(LyXCursor &);
 
        ///
-       float getCursorX(Row *, lyx::pos_type pos,
+       float getCursorX(RowList::iterator rit, lyx::pos_type pos,
                         lyx::pos_type last, bool boundary) const;
        /// used in setlayout
        void makeFontEntriesLayoutSpecific(Buffer const &, Paragraph & par);
index 69c772c087cc2a69654c453a4bfc5b3fed47d2dc..9d190a8d42c547ecc32413ca544bcabef39285ca 100644 (file)
@@ -1741,7 +1741,7 @@ void LyXText::setCursor(LyXCursor & cur, Paragraph * par,
 }
 
 
-float LyXText::getCursorX(Row * row,
+float LyXText::getCursorX(RowList::iterator rit,
                          pos_type pos, pos_type last, bool boundary) const
 {
        pos_type cursor_vpos = 0;
@@ -1750,15 +1750,15 @@ float LyXText::getCursorX(Row * row,
        float fill_hfill;
        float fill_label_hfill;
        // This call HAS to be here because of the BidiTables!!!
-       prepareToPrint(row, x, fill_separator, fill_hfill,
+       prepareToPrint(rit, x, fill_separator, fill_hfill,
                       fill_label_hfill);
 
-       if (last < row->pos())
-               cursor_vpos = row->pos();
+       if (last < rit->pos())
+               cursor_vpos = rit->pos();
        else if (pos > last && !boundary)
-               cursor_vpos = (row->par()->isRightToLeftPar(bv()->buffer()->params))
-                       ? row->pos() : last + 1;
-       else if (pos > row->pos() &&
+               cursor_vpos = (rit->par()->isRightToLeftPar(bv()->buffer()->params))
+                       ? rit->pos() : last + 1;
+       else if (pos > rit->pos() &&
                 (pos > last || boundary))
                /// Place cursor after char at (logical) position pos - 1
                cursor_vpos = (bidi_level(pos - 1) % 2 == 0)
@@ -1768,36 +1768,35 @@ float LyXText::getCursorX(Row * row,
                cursor_vpos = (bidi_level(pos) % 2 == 0)
                        ? log2vis(pos) : log2vis(pos) + 1;
 
-       pos_type body_pos = row->par()->beginningOfBody();
+       pos_type body_pos = rit->par()->beginningOfBody();
        if ((body_pos > 0) &&
-           ((body_pos-1 > last) ||
-            !row->par()->isLineSeparator(body_pos - 1)))
+           ((body_pos - 1 > last) ||
+            !rit->par()->isLineSeparator(body_pos - 1)))
                body_pos = 0;
 
-       for (pos_type vpos = row->pos(); vpos < cursor_vpos; ++vpos) {
+       for (pos_type vpos = rit->pos(); vpos < cursor_vpos; ++vpos) {
                pos_type pos = vis2log(vpos);
                if (body_pos > 0 && pos == body_pos - 1) {
                        x += fill_label_hfill +
                                font_metrics::width(
-                                       row->par()->layout()->labelsep,
+                                       rit->par()->layout()->labelsep,
                                        getLabelFont(bv()->buffer(),
-                                                    row->par()));
-                       if (row->par()->isLineSeparator(body_pos - 1))
-                               x -= singleWidth(
-                                                row->par(), body_pos - 1);
+                                                    rit->par()));
+                       if (rit->par()->isLineSeparator(body_pos - 1))
+                               x -= singleWidth(rit->par(), body_pos - 1);
                }
-               if (row->hfillExpansion(pos)) {
-                       x += singleWidth(row->par(), pos);
+               if (rit->hfillExpansion(pos)) {
+                       x += singleWidth(rit->par(), pos);
                        if (pos >= body_pos)
                                x += fill_hfill;
                        else
                                x += fill_label_hfill;
-               } else if (row->par()->isSeparator(pos)) {
-                       x += singleWidth(row->par(), pos);
+               } else if (rit->par()->isSeparator(pos)) {
+                       x += singleWidth(rit->par(), pos);
                        if (pos >= body_pos)
                                x += fill_separator;
                } else
-                       x += singleWidth(row->par(), pos);
+                       x += singleWidth(rit->par(), pos);
        }
        return x;
 }