]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
delete unused variables.
[lyx.git] / src / text.C
index 2f98e3df22f989239cca398e3b81d8d5f9fec669..8118d47f7efd0f1fb10c7b10665a26fa9a5c555f 100644 (file)
@@ -97,62 +97,6 @@ using frontend::FontMetrics;
 
 namespace {
 
-int numberOfSeparators(Paragraph const & par, Row const & row)
-{
-       pos_type const first = max(row.pos(), par.beginOfBody());
-       pos_type const last = row.endpos() - 1;
-       int n = 0;
-       for (pos_type p = first; p < last; ++p) {
-               if (par.isSeparator(p))
-                       ++n;
-       }
-       return n;
-}
-
-
-int numberOfLabelHfills(Paragraph const & par, Row const & row)
-{
-       pos_type last = row.endpos() - 1;
-       pos_type first = row.pos();
-
-       // hfill *DO* count at the beginning of paragraphs!
-       if (first) {
-               while (first < last && par.isHfill(first))
-                       ++first;
-       }
-
-       last = min(last, par.beginOfBody());
-       int n = 0;
-       for (pos_type p = first; p < last; ++p) {
-               if (par.isHfill(p))
-                       ++n;
-       }
-       return n;
-}
-
-
-int numberOfHfills(Paragraph const & par, Row const & row)
-{
-       pos_type const last = row.endpos();
-       pos_type first = row.pos();
-
-       // hfill *DO* count at the beginning of paragraphs!
-       if (first) {
-               while (first < last && par.isHfill(first))
-                       ++first;
-       }
-
-       first = max(first, par.beginOfBody());
-
-       int n = 0;
-       for (pos_type p = first; p < last; ++p) {
-               if (par.isHfill(p))
-                       ++n;
-       }
-       return n;
-}
-
-
 void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex,
        string const & token, LyXFont & font, Change & change, ErrorList & errorList)
 {
@@ -1854,8 +1798,6 @@ int LyXText::cursorX(BufferView const & bv, CursorSlice const & sl,
        if (pm.rows().empty())
                return 0;
 
-       int max_width = tm.maxWidth();
-
        pos_type ppos = sl.pos();
        // Correct position in front of big insets
        bool const boundary_correction = ppos != 0 && boundary;
@@ -1867,7 +1809,6 @@ int LyXText::cursorX(BufferView const & bv, CursorSlice const & sl,
        pos_type cursor_vpos = 0;
 
        Buffer const & buffer = *bv.buffer();
-       int const right_margin = tm.rightMargin(pm);
        RowMetrics const m = tm.computeRowMetrics(pit, row);
        double x = m.x;
 
@@ -2116,7 +2057,6 @@ pos_type LyXText::x2pos(BufferView const & bv, pit_type pit, int row,
        BOOST_ASSERT(row < int(pm.rows().size()));
        bool bound = false;
        Row const & r = pm.rows()[row];
-       Buffer const & buffer = *bv.buffer();
        return r.pos() + getColumnNearX(bv, tm.rightMargin(pm), pit, r, x, bound);
 }
 
@@ -2130,9 +2070,7 @@ pos_type LyXText::x2pos(BufferView const & bv, pit_type pit, int row,
 //}
 
 
-// x,y are screen coordinates
-// sets cursor only within this LyXText
-bool LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
+void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
 {
        BOOST_ASSERT(this == cur.text());
        pit_type pit = getPitNearY(cur.bv(), y);
@@ -2167,7 +2105,6 @@ bool LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
 
        bool bound = false;
        int xx = x;
-       Buffer const & buffer = cur.buffer();
        int right_margin = tm.rightMargin(pm);
        pos_type const pos = row.pos() + getColumnNearX(cur.bv(), right_margin, 
                pit, row, xx, bound);
@@ -2178,7 +2115,8 @@ bool LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
                << " pos: " << pos
                << endl;
 
-       return setCursor(cur, pit, pos, true, bound);
+       setCursor(cur, pit, pos, true, bound);
+       return;
 }